"use strict";
angular.module("myApp", ["ui.router", "ngResource", "ui.utils", "ngStorage", "myApp.controllers", "myApp.directives", "myApp.services", "ngDialog", "oc.lazyLoad", "ipCookie"]).run(["$http", "ipCookie", "$rootScope", "ngDialog", "$location", "Chat", "ifRegisted", "$state", "$timeout", "$window", "queryToJson", "$localStorage", "UserLevel", "CacheInfo", "LastDoc", "$stateParams",
    function(a, c, h, g, y, v, w, $, b, I, C, S, L, P, T, A) {
        function k() {
            function a() {
                return Math.floor(65536 * (1 + Math.random())).toString(16).substring(1)
            }
            return a() + "-" + a() + "-" + a() + "-" + a() + "-" + a() + "_w=" + screen.width + "_h=" + screen.height + "_dpr=" + devicePixelRatio
        }
        h.$on("$stateChangeStart",
            function(a, g, v, w) {
                var b = {
                    "/response": 1,
                    "/intro": 1,
                    "/download": 1,
                    "/notify": 1
                };
                if (y.path() in b) return ! 1;
                if (!/micromessenger/i.test(navigator.userAgent) && y.path() && !(y.path() in b)) return y.url("/useWeixin"),
                    !1;
                if (h.auth = v.auth || "", h.wxid = v.wx || v.wxid || v.wxId || A.wx || c("wxid") || "", void 0 == h.user_level) a.preventDefault(),
                    L.get({}).$promise.then(function(a) {
                        200 == a.code && (console.info("user_level:", a.msg.level), h.user_level = a.msg.level, $.go(g.name, v))
                    });
                else {
                    if (c("auth") || c("auth", A.auth), g.level && h.user_level < g.level) {
                        a.preventDefault(),
                            P.set("toState", g.name),
                            P.set("toParams", v);
                        var I = A.id || A.docid || "";
                        return h.user_level <= 0 ? $.go("home.followQr", {
                                wx: v.wx,
                                qrInfo: v.qrInfo
                            }) : h.user_level <= 10 ? !w.name || I ? T.get({
                                        wxid: h.wxid
                                    }).$promise.then(function(a) {
                                        y.path("/register").search({
                                            docid: a.msg._id,
                                            wx: h.wxid
                                        })
                                    }) : $.go("home.register", {
                                        docid: I,
                                        wx: h.wxid
                                    }) : 20 == h.user_level && $.go("home.complete", {
                                    wx: h.wxid
                                }),
                            !1
                    }
                    w.name || "home.register" != g.name || 20 != h.user_level ? !w.name && "home.register" == g.name && h.user_level > 20 && T.get({
                            wxid: c("wxid")
                        }).$promise.then(function(a) {
                            y.path("/doctor").search({
                                id: a.msg._id,
                                from: 2,
                                bizid: c("auth")
                            }).replace()
                        }) : y.path("/complete").search({
                            wx: h.wxid
                        }).replace()
                }
            }),
            h.$on("$locationChangeSuccess",
                function() {
                    return g.closeAll(),
                        h.actualLocation = y.path(),
                        I.wx.ready(function() {
                            I.wx.hideOptionMenu()
                        }),
                        h.promise ? (b.cancel(h.promise), !1) : void 0
                }),
            h.$watch(function() {
                    return y.path()
                },
                function(a, g) {
                    if (h.actualLocation === a) switch (a) {
                        case "/chat":
                            var v = C(I.location.href.split("?")[1]).pid;
                            y.path("/middle").search({
                                docid: c("docid"),
                                auth: c("auth"),
                                pid: v
                            }).replace();
                            break;
                        case "/goto_prepay":
                            /alert/.test(g) || "/refundPolicy" === g || $.go("home.doctor", {
                                id: c("docid"),
                                auth: c("auth")
                            })
                    }
                }),
            h.$on("$stateChangeSuccess",
                function(a, h, g) {
                    var v = "安心医生";
                    switch (y.path()) {
                        case "/register":
                            v = "验证手机";
                            break;
                        case "/doctor":
                            v = "医生主页";
                            break;
                        case "/apptLite":
                            v = "门诊时间";
                            break;
                        case "/apptOrderDetail":
                            v = "预约详情";
                            break;
                        case "/apptCall":
                            v = "电话咨询";
                            break;
                        case "/apptVip":
                            v = "专家面诊";
                            break;
                        case "/orderdetailCall":
                        case "/orderdetail":
                        case "/orderdetailVip":
                        case "/orderdetailQA":
                            v = "付费详情";
                            break;
                        case "/elizaAppt":
                        case "/elizaApptSub":
                            v = "预约安心名医";
                            break;
                        case "/center":
                            v = "个人中心";
                            break;
                        case "/myvip":
                            v = "VIP会员";
                            break;
                        case "/msgCenter":
                            v = "消息中心";
                            break;
                        case "/goto_prepay":
                        case "/fillChatInfo":
                        case "/chat":
                        case "/goChat":
                            var w = g.docid || g.docId || c("docid") || "";
                            v = S["docid_" + w] ? S["docid_" + w].name + "医生": "我的咨询";
                            break;
                        case "/history":
                            var $ = g.patientName;
                            v = $ ? $ + "的咨询": "咨询记录";
                            break;
                        case "/chatList":
                            v = "咨询记录";
                            break;
                        default:
                            v = "安心健康"
                    }
                    if (document.title = v, /(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
                        var b = document.getElementById("setTitle");
                        b || (b = document.createElement("iframe"), b.style.display = "none", document.body.appendChild(b)),
                            b.src = "favicon.ico?" + Math.random()
                    }
                }),
            h.$on("$stateChangeStart",
                function(a, c, h, g) {
                    var y = h.from,
                        v = h.bizid;
                    if (y) / event / .test(y) && (y = y.split("event")[1]);
                    else switch (g.name) {
                        case "home.index":
                            y = 1;
                            break;
                        case "home.doctorList":
                            y = 4;
                            break;
                        case "home.recommend":
                            y = 5;
                            break;
                        case "home.couponlist":
                            y = 6;
                            break;
                        case "home.apptOrderDetail":
                            y = 7;
                            break;
                        case "home.wxMsgLinkForCoupon":
                            y = 8;
                            break;
                        default:
                            y = S["repo-" + c.name] ? S["repo-" + c.name].from: 99
                    }
                    if (!v) switch (g.name) {
                        case "home.index":
                            v = h.auth;
                            break;
                        case "home.doctorList":
                        case "home.recommend":
                            v = h.id;
                            break;
                        case "home.couponlist":
                        case "home.wxMsgLinkForCoupon":
                            v = h.couponEntityId;
                            break;
                        default:
                            v = S["repo-" + c.name] ? S["repo-" + c.name].bizid: 0
                    }
                    "home.doctor" === c.name && (S["repo-" + c.name] = {
                        from: y,
                        bizid: v
                    })
                });
        var D = "/Public/mobile/svg/svg/common_84ca4df.svg",
            _ = document.createElement("div");
        _.style.display = "none",
            document.body.appendChild(_);
        var N = D.split("_")[0],
            O = D.split("_")[1];
        if (S[N] && O == S[N].version) _.innerHTML = S[N].content;
        else {
            var E = new XMLHttpRequest;
            E.open("get", D),
                E.onload = function() {
                    E.responseText && 200 == E.status && (_.innerHTML = E.responseText, S[N] = {
                        content: E.responseText,
                        version: O
                    })
                },
                E.send(null)
        }
        S.imei || (S.imei = k())
    }]),
    angular.module("myApp").config(["$stateProvider", "$urlRouterProvider",
        function(a, c) {
            c.when("", "/download"),
                c.when("/{beginPath:.+}{endPath:.alert}", "/{beginPath:.+}{endPath:.alert}"),
                c.otherwise("/404"),
                a.state("home.notScaned", {
                    url: "/notScaned",
                    controller: ["$location",
                        function(a) {
                            a.path("/feedbackSuc").search({
                                msg: "温馨提示",
                                icon: "caution",
                                msg_small: '需扫码关注医生后才能使用该功能<br> <a href="http://mp.weixin.qq.com/s?__biz=MzA4OTU5NzQ4Mg==&mid=206981365&idx=1&sn=67ce17e63a817d3db3adcaac923b931b&scene=1&srcid=0415H5JZqGfcxTZzZW6rQWtj">查看具体方法 》</a>'
                            }).replace()
                        }]
                }).state("home.404", {
                    url: "/404",
                    controller: ["$location",
                        function(a) {
                            a.path("/feedbackSuc").search({
                                msg: "访问出错啦",
                                icon: "error"
                            }).replace()
                        }]
                }).state("home", {
                    "abstract": !0,
                    controller: "HomeCtrl",
                    resolve: {
                        sys: ["$rootScope",
                            function(a) { / (iPhone | iPad | iPod | iOS) / i.test(navigator.userAgent) && (a.system = "ios")
                            }]
                    },
                    templateUrl: "./partials/home.html"
                }).state("home.useWeixin", {
                    url: "/useWeixin",
                    templateUrl: "./partials/useWeixin.html"
                }).state("home.userPolicy", {
                    url: "/userPolicy",
                    templateUrl: "./partials/user_policy.html"
                }).state("home.vipPolicy", {
                    url: "/vipPolicy",
                    templateUrl: "./partials/vipPolicy.html"
                }).state("home.clear", {
                    controller: ["ipCookie",
                        function(a) {
                            a.remove("auth"),
                                a.remove("auth", {
                                    path: "/"
                                }),
                                a.remove("wxid")
                        }],
                    url: "/clear",
                    template: "done!"
                }).state("home.followQr", {
                    url: "/followQr?wx&qrInfo",
                    controller: "FollowQrCtrl",
                    templateUrl: "./partials/followQr.html"
                })
        }]),
    angular.module("myApp").config(["$httpProvider", "$compileProvider",
        function(a, c) {
            a.defaults.headers.common["X-Requested-With"] = "XMLHttpRequest",
                a.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded;charset=utf-8";
            var h = function(a) {
                var c, g, y, v, w, $, i, b = "";
                for (c in a) if (g = a[c], g instanceof Array) for (i = 0; i < g.length; ++i) w = g[i],
                    y = c,
                    $ = {},
                    $[y] = w,
                    b += h($) + "&";
                else if (g instanceof Object) for (v in g) w = g[v],
                    y = c + "[" + v + "]",
                    $ = {},
                    $[y] = w,
                    b += h($) + "&";
                else void 0 !== g && null !== g && (b += encodeURIComponent(c) + "=" + encodeURIComponent(g) + "&");
                return b.length ? b.substr(0, b.length - 1) : b
            };
            a.defaults.transformRequest = [function(a) {
                return angular.isObject(a) && "[object File]" !== String(a) ? h(a) : a
            }],
                c.imgSrcSanitizationWhitelist(/^\s*((https?|ftp|file|blob|weixin|chrome-extension):|data:image\/)/),
                a.interceptors.push("authInterceptor")
        }]),
    angular.module("myApp").config(["ngDialogProvider",
        function(a) {
            a.setDefaults({
                className: "ngdialog-theme-default",
                plain: !1,
                showClose: !1,
                closeByDocument: !0,
                closeByEscape: !0,
                appendTo: !1,
                preCloseCallback: function() {}
            }),
                a.setForceBodyReload(!0)
        }]),
    angular.module("myApp").constant("weekCHList", ["日", "一", "二", "三", "四", "五", "六"]).constant("couponBizType", {
        chat: 1e3,
        call: 1001,
        vip: 1002,
        eliza: 1300,
        qa_ask: 1100,
        lecture: 1200
    }),
    angular.module("myApp.controllers", []),
    angular.module("myApp.services", []),
    angular.module("myApp").config(["$stateProvider", "$urlRouterProvider",
        function(a) {
            a.state("home.orderlist", {
                url: "/orderlist?auth&wxid",
                controller: "OrderListCtrl",
                resolve: {
                    loadJs: ["$ocLazyLoad",
                        function(a) {
                            return a.load({
                                name: "OrderListCtrl",
                                files: ["//mcdn.anxinyisheng.com/Public/mobile/js/controllers/order_db96d75.js"]
                            })
                        }]
                },
                templateUrl: "./partials/orderList.html"
            }).state("home.orderDetail", {
                url: "/orderdetail?tradeNum&name",
                controller: "OrderDetailCtrl",
                resolve: {
                    loadJs: ["$ocLazyLoad",
                        function(a) {
                            return a.load({
                                name: "OrderDetailCtrl",
                                files: ["//mcdn.anxinyisheng.com/Public/mobile/js/controllers/order_db96d75.js"]
                            })
                        }],
                    data: ["OrderDetail", "$stateParams",
                        function(a, c) {
                            return a.get({
                                tradeNum: c.tradeNum
                            }).$promise
                        }]
                },
                templateUrl: "./partials/orderDetail.html"
            }).state("home.orderDetailMyvip", {
                url: "/orderDetailMyvip?tradeNum&auth&wxid&type",
                controller: "orderDetailMyvipCtrl",
                controllerAs: "vm",
                resolve: {
                    loadJs: ["$ocLazyLoad",
                        function(a) {
                            return a.load({
                                name: "orderDetailMyvipCtrl",
                                files: ["//mcdn.anxinyisheng.com/Public/mobile/js/controllers/order_db96d75.js"]
                            })
                        }],
                    data: ["OrderDetail", "$stateParams",
                        function(a, c) {
                            return a.get({
                                tradeNum: c.tradeNum
                            }).$promise
                        }]
                },
                templateUrl: "./partials/orderDetailMyvip.html"
            }).state("home.orderDetailVip", {
                url: "/orderdetailVip?appointId&auth",
                controller: "OrderDetailVipCtrl",
                resolve: {
                    loadCss: ["$ocLazyLoad",
                        function(a) {
                            a.load("/Public/mobile/css/page/apptOrderDetail_1ae130a.css")
                        }],
                    loadJs: ["$ocLazyLoad",
                        function(a) {
                            return a.load({
                                name: "OrderDetailVipCtrl",
                                files: ["//mcdn.anxinyisheng.com/Public/mobile/js/controllers/order_db96d75.js"]
                            })
                        }],
                    data: ["OrderDetailVip", "$stateParams",
                        function(a, c) {
                            return a.get({
                                appointId: c.appointId
                            }).$promise
                        }]
                },
                templateUrl: "./partials/orderDetailVip.html"
            }).state("home.orderDetailCall", {
                url: "/orderdetailCall?callId&auth",
                controller: "OrderDetailCallCtrl",
                resolve: {
                    loadCss: ["$ocLazyLoad",
                        function(a) {
                            a.load("/Public/mobile/css/page/apptOrderDetail_1ae130a.css")
                        }],
                    loadJs: ["$ocLazyLoad",
                        function(a) {
                            return a.load({
                                name: "OrderDetailCallCtrl",
                                files: ["//mcdn.anxinyisheng.com/Public/mobile/js/controllers/order_db96d75.js"]
                            })
                        }],
                    data: ["OrderDetailCall", "$stateParams",
                        function(a, c) {
                            return a.get({
                                callId: c.callId
                            }).$promise
                        }]
                },
                templateUrl: "./partials/orderDetailCall.html"
            }).state("home.orderDetailQA", {
                url: "/orderdetailQA?qConsumeId&auth&wxid",
                controller: "OrderdetailQACtrl",
                controllerAs: "vm",
                resolve: {
                    loadJs: ["$ocLazyLoad",
                        function(a) {
                            return a.load({
                                name: "OrderdetailQACtrl",
                                files: ["//mcdn.anxinyisheng.com/Public/mobile/js/controllers/orderDetailQA_5f02ddc.js"]
                            })
                        }]
                },
                templateUrl: "./partials/orderDetailQA.html"
            }).state("home.orderDetailLec", {
                url: "/orderdetailLec?tradeNum&auth&wxid&type",
                controller: "OrderdetailQACtrl",
                controllerAs: "vm",
                resolve: {
                    loadJs: ["$ocLazyLoad",
                        function(a) {
                            return a.load({
                                name: "OrderdetailQACtrl",
                                files: ["//mcdn.anxinyisheng.com/Public/mobile/js/controllers/orderDetailLec_fe155af.js"]
                            })
                        }]
                },
                templateUrl: "./partials/orderDetailLec.html"
            }).state("home.refundPolicyLec", {
                url: "/refundPolicyLec",
                templateUrl: "./partials/refund_policy_lec.html"
            })
        }]),
    angular.module("myApp").config(["$stateProvider", "$urlRouterProvider",
        function(a) {
            a.state("home.wxMsgLink", {
                url: "/wxMsgLink?type&docid&couponEntityId&wx",
                plain: !0,
                controller: ["ipCookie", "$location", "Alert", "$window",
                    function(a, c, h, g) {
                        var y = c.$$search;
                        switch (y.type) {
                            case "coupon":
                                c.path("/wxMsgLinkForCoupon").replace();
                                break;
                            case "coupon_qa":
                                c.path("/wxMsgLinkForCouponQA").replace();
                                break;
                            case "coupon_qa_expire":
                                c.path("/wxMsgLinkForCouponQAExpire").replace();
                                break;
                            case "coupon_eliza_registration":
                                c.path("/wxMsgLinkForCouponEliza").replace();
                                break;
                            case "vip":
                                c.path("/wxMsgLinkForVip").replace();
                                break;
                            case "myvip":
                                c.path("/wxMsgLinkForMyVip").replace();
                                break;
                            default:
                                h.alert("无次模版消息类型",
                                    function() {
                                        g.wx.closeWindow()
                                    })
                        }
                    }]
            }).state("home.wxMsgLinkForVip", {
                url: "/wxMsgLinkForVip?docid&auth&wx&from&to&prefrom",
                level: 30,
                plain: !0,
                controller: ["$http", "$stateParams", "ipCookie", "$location",
                    function(a, c, h, g) {
                        var y = c;
                        g.path("/apptVip").search(y).replace()
                    }]
            }).state("home.wxMsgLinkForMyVip", {
                url: "/wxMsgLinkForMyVip?docid&auth&wx",
                level: 10,
                plain: !0,
                controller: ["$http", "$stateParams", "ipCookie", "$location",
                    function(a, c, h, g) {
                        var y = c;
                        g.path("/myvip").search(y).replace()
                    }]
            }).state("home.wxMsgLinkForCoupon", {
                url: "/wxMsgLinkForCoupon?docid&wx&couponEntityId&auth&from",
                plain: !0,
                level: 10,
                resolve: {
                    doctorCount: ["DoctorCount", "$stateParams",
                        function(a) {
                            return a.get({}).$promise
                        }]
                },
                controller: ["$stateParams", "ipCookie", "$location", "LastDoc", "doctorCount",
                    function(a, c, h, g, y) {
                        var v = a;
                        v.id = v.docid,
                            v.auth = v.auth || c("auth"),
                            a.docid || 1 == y.msg.count ? (v.id = a.docid || y.msg.docId, h.path("/doctor").search(v).replace()) : h.path("/doctorList").search(v).replace()
                    }]
            }).state("home.wxMsgLinkForCouponQA", {
                url: "/wxMsgLinkForCouponQA?docid&wx&couponEntityId&auth&from",
                plain: !0,
                level: 10,
                controller: ["$stateParams", "$window", "$location",
                    function(a, c, h) {
                        var g = a,
                            y = "couponEntityId=" + g.couponEntityId + "&from=biz_wxMsg_coupon";
                        c.location.href = a.docid ? "http://" + h.$$host + "/home/wx/toYdIndex?docid=" + g.docid + "&" + y: "http://" + h.$$host + "/home/wx/toYdAsk?" + y
                    }]
            }).state("home.wxMsgLinkForCouponQAExpire", {
                url: "/wxMsgLinkForCouponQAExpire?docid&wx&couponEntityId&auth&from",
                plain: !0,
                level: 10,
                controller: ["$stateParams", "$window", "$location",
                    function(a, c, h) {
                        var g = a,
                            y = "couponEntityId=" + g.couponEntityId + "&from=biz_wxMsg_coupon";
                        c.location.href = a.docid ? "http://" + h.$$host + "/home/wx/toYdIndex?docid=" + g.docid + "&" + y: "http://" + h.$$host + "/home/wx/toYdAsk?" + y
                    }]
            }).state("home.wxMsgLinkForCouponEliza", {
                url: "/wxMsgLinkForCouponEliza?docid&wx&couponEntityId&auth&from",
                plain: !0,
                level: 10,
                controller: ["$stateParams", "$window", "$location",
                    function(a, c, h) {
                        var g = a,
                            y = "couponEntityId=" + g.couponEntityId + "&from=biz_wxMsg_coupon";
                        c.location.href = "http://" + h.$$host + "/home/wx/toElizabethPromote?" + y
                    }]
            })
        }]),
    angular.module("myApp").config(["$stateProvider", "$urlRouterProvider",
        function(a) {
            a.state("home.download", {
                url: "/download",
                controller: "DownLoadCtrl",
                templateUrl: "./partials/download.html"
            }).state("home.introduction", {
                url: "/intro",
                templateUrl: "./partials/introduction.html"
            }).state("home.response", {
                url: "/response?_id",
                controller: "ResponseCtrl",
                resolve: {
                    data: ["Response", "$stateParams",
                        function(a, c) {
                            return a.get({
                                _id: c._id
                            }).$promise
                        }]
                },
                templateUrl: "./partials/response.html"
            }).state("home.notify", {
                url: "/notify?notifyId",
                controller: "notify",
                resolve: {
                    data: ["ipCookie", "$stateParams", "$http",
                        function(a, c, h) {
                            a("auth") || (a("auth", c.auth), h.defaults.headers.common.Auth = a("auth"))
                        }],
                    notify: ["GetNotify", "$stateParams",
                        function(a, c) {
                            return a.post({
                                notifyId: c.notifyId
                            }).$promise
                        }]
                },
                templateUrl: "./partials/notify.html"
            })
        }]),
    angular.module("myApp.controllers").controller("MainCtrl",
        function() {}).controller("HomeCtrl",
        function() {}).controller("ResponseCtrl", ["$scope", "$state", "data",
        function(a, c, h) {
            a.data = h
        }]).controller("DownLoadCtrl", ["$scope",
        function(a) {
            a.sys = "",
                a.sys = /(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent) ? "ios": /(Android)/i.test(navigator.userAgent) ? "android": "pc"
        }]).controller("notify", ["$sce", "$scope", "$state", "$location", "$stateParams", "ipCookie", "Img", "Alert", "$window", "notify", "AddNotifyReadNum",
        function(a, c, h, g, y, v, w, $, b, I, C) {
            c.notify = I.msg.notify;
            var S = I.msg.notify.ct;
            S = new Date(1e3 * Number(S));
            var L = function(a) {
                return parseInt(a, 10) >= 10 ? "" + a: "0" + a
            };
            c.time = S.getFullYear() + "." + L(S.getMonth() + 1) + "." + L(S.getDate()),
                c.notify.read_num++,
                c.notify.content = a.trustAsHtml(c.notify.content),
                c.checkImg = function(a) {
                    w.alert(a)
                },
                C.post({
                    notifyId: y.notifyId
                })
        }]).controller("FollowQrCtrl", ["QrFromShare", "$scope", "$stateParams", "$sessionStorage", "QrMoreDocsFromShare", "QrQueenFromShare", "$state",
        function(a, c, h, g, y, v, w) {
            if ("null" == h.qrInfo && (h.qrInfo = null), h.qrInfo) var $ = JSON.parse(h.qrInfo);
            else {
                var b = JSON.parse(sessionStorage.getItem("followQr")) || g.followQr || JSON.parse(sessionStorage.getItem("share_freeask"));
                if (b) var $ = b;
                else var $ = null
            }
            console.log($);
            var I = {
                shareDocId: $ ? $.share_docid: "",
                shareTo: $ ? $.share_to: "",
                type: $ ? $.type: ""
            };
            if (null == $ && w.go("home.notScaned"), "undefined" == typeof $.name) a.save(I).$promise.then(function(a) {
                c.qr = a.msg.qr
            });
            else switch ($.name) {
                case "eliza":
                    v.save(I).$promise.then(function(a) {
                        c.qr = a.msg.qr
                    });
                    break;
                case "recommend":
                    y.save(I).$promise.then(function(a) {
                        c.qr = a.msg.qr
                    })
            }
        }]),
    angular.module("myApp").config(["$stateProvider", "$urlRouterProvider",
        function(a) {
            a.state("home.doctorList", {
                url: "/doctorList?auth&wx&couponEntityId&from&bizid",
                controller: "DoctorListCtrl",
                resolve: {
                    doctor: ["Doctor", "$stateParams", "ipCookie", "$http",
                        function() {}]
                },
                templateUrl: "./partials/doctor_list.html"
            }).state("home.doctor", {
                url: "/doctor?id&wx&auth&couponEntityId&from&anchor&bizid&qrInfo",
                controller: "DoctorCtrl",
                level: 10,
                resolve: {
                    docQuery: ["Doctor", "$stateParams", "ipCookie", "$http", "$localStorage",
                        function(a, c, h, g, y) {
                            h("docid", c.id);
                            var v = {
                                _id: c.id
                            };
                            return y["repo-home.doctor"] && (v.from = y["repo-home.doctor"].from, v.bizid = y["repo-home.doctor"].bizid),
                                v
                        }],
                    loadGoShare: ["$ocLazyLoad",
                        function(a) {
                            return a.load({
                                name: "goShare",
                                files: ["//mcdn.anxinyisheng.com/Public/mobile/js/services/goShare_18316b9.js"]
                            })
                        }]
                },
                templateUrl: "./partials/doctor_index.html"
            })
        }]),
    angular.module("myApp.controllers").controller("DoctorListCtrl", ["$scope", "$state", "Doctor", "ipCookie", "CacheInfo", "$stateParams",
        function(a, c, h, g, y, v) {
            return a.auth = g("auth"),
                a.couponEntityId = c.params.couponEntityId,
                a.isLoading = !0,
                y.get("doctorList") ? (a.doctor = y.get("doctorList"), a.isLoading = !1, !1) : void h.get({
                        from: v.from || "",
                        bizid: v.bizid || ""
                    }).$promise.then(function(c) {
                        a.doctor = c,
                            a.isLoading = !1,
                            y.set("doctorList", c)
                    })
        }]).controller("DoctorCtrl", ["$location", "CacheInfo", "Doctor", "$window", "$scope", "$state", "$stateParams", "$localStorage", "docQuery", "ipCookie", "Chat", "PayWayCheck", "Alert", "Notice", "ApptPrice", "QARecommend", "$timeout", "UserLevel", "CouponState", "ApptList", "ParseDate", "weekCHList", "DocRecommendReward", "Prompt", "getHost", "goShare", "GetTimeList", "isDuringTime", "couponBizType",
        function(a, c, h, g, y, v, w, $, b, I, C, S, L, P, T, A, k, D, _, N, O, E, M, z, R, B, F, U, H) {
            y.isDuringQafree = U({
                type: "qafree"
            }).isDuring;
            var W;
            h.info.get(b).$promise.then(function(h) {
                W = h,
                    y.doctor = W,
                    c.set("isOnLightAppoint", h.msg.isOnLightAppoint),
                    "chat" == w.anchor ? k(function() {
                                var a = angular.element(document.querySelector("#online").offsetTop);
                                console.log(a),
                                    g.scrollTo(0, a[0] - 54)
                            },
                            500) : k(function() {
                                g.scrollTo(0, 0)
                            },
                            500),
                    $["docid_" + W.msg._id] = W.msg,
                    y.couponTxt = {};
                var v = function(a, c, h, g) {
                    1 == a ? y.couponTxt[g] = c - h > 432e3 ? "有免费券还未使用": "免费券即将到期": 2 == a && (y.couponTxt[g] = c - h > 432e3 ? "有优惠券还未使用": "优惠券即将到期")
                };
                if (_.save({
                        docId: w.id
                    }).$promise.then(function(a) {
                        if (200 == a.code) {
                            var c = a.msg.serverTime,
                                h = a.msg.list[H.chat],
                                g = a.msg.list[H.qa_ask];
                            h && v(h.couponState, h.couponEt, c, "online"),
                            g && v(g.couponState, g.couponEt, c, "qaask")
                        }
                    }), y.doctor.msg.isEliza && (y.discountVip = !0), W.msg.isEliza && W.msg.isQueenSchedule) {
                    var b = W.msg.scheduleList;
                    y.elizaScheduleText = "";
                    for (var i = 0; i < b.length; i++) {
                        var C = new Date(1e3 * parseInt(b[i].queenScheduleSt, 10)),
                            S = C.getMonth() + 1,
                            L = C.getDate(),
                            P = E[C.getDay()];
                        if (C.getHours() <= 12) var T = "上午";
                        else if (C.getHours() <= 18) var T = "下午";
                        else var T = "晚上";
                        var D = S + "月" + L + "日周" + P + T;
                        y.elizaScheduleText += b[i].appointFee ? "【" + D + "】我在" + b[i].queenHospitalName + "会诊，就诊名额有限，点击抢先预约。": "【" + D + "】我在" + b[i].queenHospitalName + "会诊，免费就诊名额有限，点击抢先预约。",
                            console.log(y.elizaScheduleText)
                    }
                }
                k(function() {
                        "skill,notice".replace(/[^, ]+/g,
                            function(a) {
                                y["is" + a + "Show"] = !1,
                                    y["is" + a + "Overflow"] = !1,
                                    y["is" + a + "ellispise"] = !1;
                                var c = document.querySelector("#" + a);
                                if (!c) return ! 1;
                                var h;
                                switch (a) {
                                    case "skill":
                                        h = .587;
                                        break;
                                    case "notice":
                                        h = 1.07
                                }
                                angular.element(c).height() > g.lib.flexible.rem2px(h) && (y["is" + a + "Overflow"] = !0, y["is" + a + "ellispise"] = !0)
                            })
                    },
                    20);
                var N = w.id;
                y.qaList = [],
                    y.isMoreBusy = !1;
                var O = 0,
                    M = 20;
                return y.loadMore = function() {
                    return y.resText = "正在努力加载",
                        y.isMoreBusy || y.qaList.length && y.qaList.length >= y.answeredCount ? (y.isShowMoreLoading = !1, !1) : (y.isMoreBusy = !0, void A.save({
                                pageIndex: ++O,
                                pageSize: M,
                                docId: N
                            }).$promise.then(function(a) {
                                if (200 == a.code) {
                                    y.doc = a.msg.docDetail,
                                        y.isQaOn = a.msg.isOn,
                                        y.answeredCount = a.msg.answeredCount,
                                        y.isMoreBusy = !1;
                                    var c = a.msg.lists;
                                    if (c.length || (y.resText = "暂时没有回答"), !c[0]) return y.isShowMoreLoading = !1,
                                        !1;
                                    c.length >= M && (y.isShowMoreLoading = !0);
                                    for (var i = 0; i < c.length; i++) y.qaList.push(c[i]);
                                    y.qaList = F(CONFIG.serverTime, y.qaList)
                                } else y.isMoreBusy = !1
                            }))
                },
                    y.loadMore(),
                    y.goDetail = function(c) {
                        g.location.href = "http://" + a.$$host + "/home/wx/toYdDetail?questionId=" + c + "&from=biz_qa_doctor_main"
                    },
                    y.doctor.msg.canShare ? (B({
                                docId: w.id,
                                shareFrom: "main_doctor",
                                shareWxId: w.wx || I("wxid") || "",
                                shareAuth: w.auth || I("auth") || ""
                            },
                            {
                                title: "我推荐了一名安心好医生，Ta很专业",
                                desc: "微信咨询健康问题，就来「安心健康」",
                                link: R.host + "/home/wx/toInviteShareInfo",
                                imgUrl: "http://mcdn.anxinyisheng.com/Public/mobile/img/common/logo_share_f5d2ed7.png"
                            },
                            {
                                docId: w.id,
                                shareFrom: "main_doctor"
                            },
                            "doctorindex"), void V()) : !1
            }),
                y.showText = function(a) {
                    y["is" + a + "Overflow"] && (y["is" + a + "Show"] = !y["is" + a + "Show"], y["is" + a + "ellispise"] = !y["is" + a + "ellispise"])
                },
                y.auth = I("auth");
            var G = function(a) {
                    return "OnLightAppoint" == a ? !0 : "OnVipAppoint" == a && y.doctor.msg.isEliza ? !0 : "OnQA" == a ? !!y.doctor.msg.qa.isOn: !!y.doctor.msg["is" + a]
                },
                Q = function(a) {
                    return 4 !== Number(a) && 3 !== Number(a) && 7 !== Number(a)
                };
            y.goReward = function(a) {
                if (Q(a)) {
                    var c = {
                        from: w.from || "doc",
                        wx: I("wxid")
                    };
                    w.bizid && (c.bizid = w.bizid),
                        v.go("home.reward", c)
                } else L.alert("该医生已停诊")
            },
                y.goAppt = function(c, h) {
                    if (!G(h)) return ! 1;
                    if (!Q(c)) return L.alert("该医生已停诊"),
                        !1;
                    switch (h) {
                        case "OnVipAppoint":
                            var w = {
                                docid: I("docid"),
                                auth: I("auth"),
                                wx: I("wxid")
                            };
                            y.discountVip && (w.from = "MAIN_DOCTOR", w.to = "MAIN_ELIZA"),
                                y.doctor.msg.isEliza ? v.go("home.elizaAppt", w) : v.go("home.apptVip", w);
                            break;
                        case "OnLightAppoint":
                            y.lightSchedule && !y.discountVip && v.go("home.apptLite");
                            break;
                        case "OnCall":
                            v.go("home.apptCall", {
                                docid: I("docid"),
                                auth: I("auth"),
                                wx: I("wxid")
                            });
                            break;
                        case "OnQA":
                            g.location.href = "http://" + a.$$host + "/home/wx/toYdIndex?docid=" + y.doctor.msg._id
                    }
                },
                y.isIoBusy = !1,
                y.goChat = function() {
                    return Q(y.doctor.msg.audit_status) ? void v.go("home.goChat", {
                            from: "biz_docIndex",
                            docId: I("docid"),
                            auth: I("auth"),
                            couponEntityId: w.couponEntityId
                        }) : (L.alert("该医生已停诊"), !1)
                },
                y.lightSchedule = !1,
                h.lightSchedule.get({
                    docId: w.id
                }).$promise.then(function(a) {
                    if (200 === a.code) {
                        var h = a.msg.list;
                        c.set("lightSchedule_" + w.id, a);
                        for (var i = 0,
                                 g = h.length; g > i; i++) if (h[i].amIsOn || h[i].pmIsOn) {
                            y.lightSchedule = h;
                            break
                        }
                        y.isOnDuty = a.msg.isOnDuty
                    }
                });
            var V = function() {
                k(function() {
                    wx.ready(function() {
                        wx.showOptionMenu(),
                            wx.hideMenuItems({
                                menuList: ["menuItem:share:qq", "menuItem:share:weiboApp", "menuItem:share:QZone", "menuItem:share:facebook", "menuItem:originPage", "menuItem:readMode", "menuItem:openWithQQBrowser", "menuItem:openWithSafari", "menuItem:share:email", "menuItem:editTag", "menuItem:delete", "menuItem:copyUrl"]
                            })
                    })
                }),
                    y.showRecommendReward = function() {
                        y.isRecommendRewardShow = !0,
                            M.get({
                                docId: w.id
                            }).$promise.then(function(a) {
                                200 === a.code && (y.recommendSucTimes = a.msg.shareSucCount, y.recommendRewardGotten = a.msg.rewardGotCount)
                            })
                    },
                    y.hideRecommendReward = function() {
                        y.isRecommendRewardShow = !1
                    },
                    y.showRecommendRewardRule = function(a) {
                        a.stopPropagation(),
                            z.alert("", "奖励规则", ["分享“医生页面”给您的朋友，每成功邀请一位新用户关注该医生，您可获得两张5折的一答提问券（最高优惠10元）；你的朋友成功关注医生后即可获得一张1元在线咨询券，仅需1元便可咨询三甲名医。", " ", "查询请点击微信菜单“更多服务”-“抵用券”"], "知道了",
                                function() {},
                                !0)
                    },
                    y.isRecommendRewardScrolling = !1;
                var a = null,
                    c = function() {
                        a && k.cancel(a),
                            a = k(function() {
                                y.isRecommendRewardScrolling = !0
                            })
                    };
                g.addEventListener("touchmove", c),
                    g.addEventListener("touchend",
                        function() {
                            a && k.cancel(a),
                                a = k(function() {
                                        y.isRecommendRewardScrolling = !1
                                    },
                                    1e3)
                        })
            }
        }]),
    angular.module("myApp").config(["$stateProvider", "$urlRouterProvider",
        function(a) {
            a.state("home.patient", {
                url: "/patient?auth&wx",
                level: 30,
                controller: "PatientCtrl",
                resolve: {
                    patients: ["PatientsList",
                        function(a) {
                            return a.get().$promise
                        }]
                },
                templateUrl: "./partials/patient_info.html"
            }).state("home.register", {
                url: "/register?docid&wx&from&reload",
                controller: "TelRegCtrl",
                level: 10,
                templateUrl: "./partials/telRegister.html"
            }).state("home.complete", {
                url: "/complete?auth&wx&chatId&couponEntityId",
                controller: "cptCtrl",
                level: 20,
                resolve: {
                    supportDate: ["$ocLazyLoad",
                        function(a) {
                            var c = "testDate",
                                h = document.createElement("input");
                            h.setAttribute("type", "date"),
                                h.style.cssText = "position:absolute;visibility:hidden;",
                                h.value = c;
                            var g = !(h.value == c);
                            return g || (a.load("//mcdn.anxinyisheng.com/Public/mobile/bower/css/angular-datepicker_cebea3a.css"), a.load("//mcdn.anxinyisheng.com/Public/mobile/bower/js/angular-datepicker_95d8d4a.js")),
                                g
                        }]
                },
                templateUrl: "./partials/complete.html"
            })
        }]),
    angular.module("myApp.controllers").controller("PatientCtrl", ["$scope", "$state", "patients", "ipCookie", "ParseDate", "$window", "LastDoc",
        function(a, c, h, g, y) {
            a.patients = h.msg.patients;
            for (var i = 0; i < a.patients.length; i++) a.patients[i].birth = y(1e3 * Number(a.patients[i].birth)).slice(0, 10),
                a.patients[i].sex = "0" == a.patients[i].sex ? "男": "女"
        }]).controller("TelRegCtrl", ["$scope", "$location", "telReg", "Toast", "CodeVerify", "$stateParams", "$interval", "ipCookie", "$window", "CacheInfo", "$state", "$http", "$timeout", "$rootScope", "AfterUpUserLevel",
        function(a, c, h, g, y, v, w, $, b, I, C, S, L, P, T) {
            $("docid", v.id),
                a.regInfo = {},
                a.regBusy = !1,
                a.sendFlag = !0,
                a.canSubmit = !1;
            var A, k = !1;
            a.getCode = function(c) {
                if (c && /^1\d{10}$/gi.test(c)) {
                    if (k) return ! 1;
                    k = !0,
                        y.save({
                                mobile: c
                            },
                            function(c) {
                                200 == c.code ? (g.alert("验证码已发送到您的手机"), a.sendFlag = !1, a.seconds = 60, w.cancel(A), A = w(function() {
                                            a.seconds--,
                                            a.seconds <= 0 && (a.sendFlag = !0, k = !1, a.seconds = 60)
                                        },
                                        1e3)) : (g.alert(c.msg), k = !1)
                            })
                } else {
                    a.mobileError = !0;
                    var h = c ? "手机号不正确": "请填写手机号";
                    g.alert(h)
                }
            },
                a.clear = function(c) {
                    a.regInfo[c] = "",
                        a["isclear_" + c] = !1
                },
                a.hasContent = function(c, h) {
                    a["isclear_" + c] = !!h
                },
                a.canQueryCode = !1,
                a.$watch("regInfo.mobile",
                    function() {
                        a.canQueryCode = !!a.regInfo.mobile && /^1\d{10}$/gi.test(a.regInfo.mobile),
                            a.canSubmit = !!a.regInfo.mobile && !!a.regInfo.code
                    }),
                a.focus = function(c) {
                    a[c + "Error"] = !1
                },
                a.register = function() {
                    return a.regBusy ? !1 : a.regInfo.mobile ? /^1\d{10}$/gi.test(a.regInfo.mobile) ? a.regInfo.code ? (a.regInfo.doctor = v.docid, a.regInfo.wx_id = v.wx || P.wxid, void h.save(a.regInfo,
                                        function(h) {
                                            return a.regBusy = !0,
                                                200 != h.code ? (a.regBusy = !1, g.alert(h.msg), !1) : (g.alert("验证成功"), P.user_level = h.msg.user_level || 20, $("auth", h.msg.auth), a.regBusy = !1, w.cancel(A), v.reload ? (c.path("/center").search({
                                                            wx: $("wxid"),
                                                            auth: $("auth")
                                                        }).replace(), !1) : void(P.user_level >= 30 ? T() : c.path("/complete").search({
                                                                wx: $("wxid")
                                                            }).replace()))
                                        })) : (a.codeError = !0, g.alert("请填写验证码"), !1) : (a.mobileError = !0, g.alert("手机号不正确"), !1) : (a.mobileError = !0, g.alert("请填写手机号"), !1)
                }
        }]).controller("cptCtrl", ["Complete", "$stateParams", "$scope", "Toast", "$timeout", "bLength", "supportDate", "CacheInfo", "$state", "Chat", "ipCookie", "$window", "PayWayCheck", "$location", "ChatInfoCache", "Time", "CreatePatient", "LastDoc", "$rootScope", "AfterUpUserLevel",
        function(a, c, h, g, y, v, w, $, b, I, C, S, L, P, T, A, k, D, _, N) {
            h.supportDate = w,
                h.cptInfo = {
                    birth: new Date("1980/1/1")
                };
            var O = 0;
            h.whichSex = function(a) {
                h.cptInfo.sex = a,
                    O = 1
            };
            var E;
            h.clear = function() {
                h.cptInfo.name = ""
            },
                h.focus = function() {
                    h.isNameError = !1
                },
                h.dateChosen = !1,
                h.chooseDate = function() {
                    var a = angular.element(document.querySelector("#birth"))[0].value;
                    h.dateChosen = !!a
                },
                h.ioBusy = !1,
                h.complete = function() {
                    if (!h.cptInfo.name) return g.alert("请填写姓名"),
                        !1;
                    if (v(h.cptInfo.name) > 30) return h.isNameError = !0,
                        g.alert("姓名不能超过15个字"),
                        !1;
                    if (/[^\u4E00-\u9FA5^a-z^A-Z^0-9]/gi.test(h.cptInfo.name)) return h.isNameError = !0,
                        g.alert("姓名只能输入中文、英文和数字"),
                        !1;
                    if (!h.cptInfo.sex) return g.alert("请选择性别"),
                        !1;
                    if (E = angular.element(document.querySelector("#birth"))[0].value, !E || !h.dateChosen) return g.alert("请填写生日"),
                        !1;
                    h.ioBusy = !0;
                    var y = angular.copy(h.cptInfo);
                    y.birth = new Date(E).getTime() / 1e3,
                        y.wx_id = C("wxid") || c.wx || c.wxId || c.wxid,
                        y.from = c.chatId ? 2 : 3,
                        _.user_level >= 30 ? k.save(y,
                                function(a) {
                                    200 == a.code ? (h.ioBusy = !1, g.alert("创建成功",
                                            function() {
                                                c.chatId && T.setCurPatient(c.chatId, a.msg.pid),
                                                    P.path("/patient").search({
                                                        wx: C("wxid"),
                                                        auth: C("auth")
                                                    }).replace()
                                            })) : (g.alert(a.msg.desc), h.ioBusy = !1)
                                },
                                function(a) {
                                    g.alert(a.data.msg.desc),
                                        h.ioBusy = !1
                                }) : a.save(y,
                                function(a) {
                                    return 200 != a.code ? (g.alert(a.msg), h.ioBusy = !1, !1) : (_.user_level = 30, g.alert("提交成功",
                                            function() {
                                                h.ioBusy = !1
                                            }), void N())
                                },
                                function(a) {
                                    g.alert(a.data.msg),
                                        h.ioBusy = !1
                                })
                }
        }]),
    angular.module("myApp.services").factory("AfterUpUserLevel", ["$timeout", "LastDoc", "CacheInfo", "$window", "$location", "ipCookie", "Alert",
        function(a, c, h, g, y, v) {
            return function() {
                if (h.get("lastPath")) {
                    var a = h.get("lastPath");
                    return y.path(a.path).search(a.search).replace(),
                        !1
                }
                if (!h.get("toState")) return c.get({
                    wxid: v("wxid")
                }).$promise.then(function(a) {
                    y.path("/doctor").search({
                        id: a.msg._id,
                        from: 2,
                        bizid: v("auth")
                    }).replace()
                }),
                    !1;
                var g = h.get("toState").slice(5),
                    w = h.get("toParams");
                y.path("/" + g).search(w).replace()
            }
        }]),
    angular.module("myApp").config(["$stateProvider", "$urlRouterProvider",
        function(a) {
            a.state("home.middle", {
                url: "/middle?docid&auth&pid&from&bizid",
                plain: !0,
                resolve: {
                    check: ["Chat", "ipCookie", "$stateParams", "$http", "$localStorage",
                        function(a, c, h, g, y) {
                            return c("auth", h.auth),
                                c("docid", h.docid),
                                y["repo-home.doctor"] = {
                                    from: h.from,
                                    bizid: h.bizid
                                },
                                a.exist.get({
                                    docid: h.docid
                                }).$promise
                        }]
                },
                controller: ["$state", "check", "ipCookie", "$stateParams", "$location", "Alert",
                    function(a, c, h, g, y, v) {
                        return 401 === c.code ? !1 : 200 !== c.code ? (v.alert(c.msg,
                                    function() {
                                        y.path("/doctor").search({
                                            id: h("docid"),
                                            auth: h("auth")
                                        }).replace()
                                    }), !1) : void("1" == c.msg.status && c.msg.pid == g.pid ? y.path("/chat").search({
                                        docid: h("docid"),
                                        auth: h("auth"),
                                        pid: g.pid
                                    }).replace() : "2" == c.msg.status ? y.path("/fillChatInfo").search({
                                            docid: h("docid"),
                                            auth: h("auth"),
                                            chatId: c.msg.chatId
                                        }).replace() : y.path("/history").search({
                                            pid: g.pid
                                        }).replace())
                    }]
            }).state("home.chat", {
                url: "/chat?docid&auth&pid",
                resolve: {
                    limit: ["Chat", "$stateParams",
                        function(a, c) {
                            return a.limit.get({
                                pid: c.pid
                            }).$promise
                        }],
                    history: ["Chat", "ipCookie", "$stateParams",
                        function(a, c, h) {
                            var g = c("docid");
                            return a.history.get({
                                docid: g,
                                page: 1,
                                pid: h.pid
                            }).$promise
                        }],
                    uploadModeisWx: ["$window", "$ocLazyLoad",
                        function(a, c) {
                            var h = a.CONFIG && a.CONFIG.uploadMode && 2 === parseInt(a.CONFIG.uploadMode) ? !0 : !1;
                            return ! h && c.load("//mcdn.anxinyisheng.com/Public/mobile/bower/js/angular-file-upload_9c66581.js"),
                                c.load("/Public/mobile/css/module/chat_192d606.css"),
                                h
                        }]
                },
                controller: "ChatCtrl",
                templateUrl: "./partials/chat.html"
            })
        }]),
    angular.module("myApp.controllers").controller("ChatCtrl", ["AD", "uploadModeisWx", "UploadWx", "$ocLazyLoad", "limit", "history", "ipCookie", "$rootScope", "$location", "Alert", "Img", "ngDialog", "$scope", "Chat", "$sce", "$window", "$timeout", "$stateParams", "$localStorage",
        function(a, c, h, g, y, v, w, $, b, I, C, S, L, P, T, A, k, D, _) {
            L.mt = "",
                L.tt,
                L.closeDia = "",
                L.docid = w("docid"),
                L.auth = w("auth"),
                L.totalShow = parseInt(y.msg.total_num),
                L.uploadUseSDK = !!c,
                L.now = (new Date).getTime(),
            _["docid_" + L.docid] && _["docid_" + L.docid].name && (L.docIcon = _["docid_" + L.docid].icon);
            var N = D.pid,
                O = angular.element(document.querySelector("#curChat")),
                E = angular.element(document.querySelector("#chat_tools")),
                M = angular.element(document.querySelector(".mainContent")),
                z = E.height();
            if (M.height(A.innerHeight - window.lib.flexible.rem2px(3.16)), setTimeout(function() {
                        O.css("min-height", E.offset().top - O.offset().top + "px")
                    },
                    200), L.$watch("addMsg",
                    function(a) {
                        a && (O.height(O.height() + z), M.height(M.height() + z), M.css("padding-bottom", 0))
                    }), L.data = {
                    msg: {
                        log: [],
                        _id: "",
                        reply: 0
                    }
                },
                    L.isMingYi = v.doc ? v.doc.isMingYi: !1, L.history = v, L.dataList = [v], L.history.log) {
                0 == L.page && (L.page = 1),
                    L.history.log.unshift(1 == L.history.type ? {
                            type: "8",
                            body: L.history.mt,
                            count: v.count
                        }: {
                            type: "8",
                            body: L.history.mt,
                            from: "doc"
                        });
                for (var R = 0; R < L.history.log.length; R++) L.history.log[R].curPage = 1
            }
            L.page = 1,
                L.more = function() {
                    L.page++,
                        P.history.get({
                                docid: L.docid,
                                page: L.page,
                                pid: N
                            },
                            function(a) {
                                a.log.unshift(1 == a.type ? {
                                        type: "8",
                                        body: a.mt,
                                        count: a.count
                                    }: {
                                        type: "8",
                                        body: a.mt,
                                        count: a.count,
                                        from: "doc"
                                    });
                                for (var c = 0; c < a.log.length; c++) a.log[c].curPage = L.page;
                                L.dataList.unshift(a)
                            })
                },
                L.open = function(a) {
                    C.alert(a)
                };
            var B = parseInt(y.msg.total_num),
                F = 3600 * parseInt(y.msg.time),
                U = 3600 * parseInt(y.msg.remind_time);
            L.hasReply = !1,
                function Y() {
                    if (L.data) {
                        for (var a = !1,
                                 i = 0; i < L.data.msg.log.length; i++) if (L.data.msg.log.ioBusy) {
                            a = !0;
                            break
                        }
                        if (L.isUploadImg || a) return $.promise = k(Y, 5e3),
                            !1
                    }
                    var c = P.query({
                            docid: L.docid,
                            mt: L.mt,
                            pid: N
                        },
                        function() {
                            c.msg.type && (L.isDocChat = 2 == c.msg.type ? !0 : !1),
                                L.data = 0 == c.msg.length ? L.data: c,
                                L.intime = L.mt ? "1": L.data.msg.intime,
                            "reply" in L.data.msg && (L.hasReply = !!L.data.msg.reply);
                            var a = (B - L.data.msg.reply, Date.parse(new Date) / 1e3),
                                h = a - L.data.msg.ct,
                                g = F - h;
                            if (U >= g && g >= U - 3600 && (I.alert("还剩" + y.msg.remind_time + "小时"), U = 0), L.data.msg instanceof Array || (L.mt = L.data.msg.mt), "3" == L.data.msg.status) {
                                var v = "1" == L.data.msg.type ? "本次咨询已结束，感谢使用": "本次随访已结束，感谢使用";
                                I.alert(v,
                                    function() {
                                        b.path("/history").replace()
                                    }),
                                    L.addMsg = !0,
                                    L.hasReply = !0
                            }
                            0 !== c.msg.length && (L.chatId = c.msg._id),
                            "3" != L.data.msg.status && ($.promise = k(Y, 5e3))
                        },
                        function() {
                            $.promise = k(Y, 5e3)
                        })
                } ();
            var H = "";
            if (L.uploadUseSDK) {
                var W = !1,
                    G = function() {
                        W = !1,
                            L.data.msg.log = [].concat(L.data.msg.log.slice(0, H), L.data.msg.log.slice(H + 1))
                    },
                    Q = function() {
                        W = !1;
                        var a = {
                            from: "user",
                            type: "403"
                        };
                        L.data.msg.log[H] = a
                    };
                L.uploadWithSDK = function() {
                    if (W) return ! 1;
                    W = !0;
                    var a = {
                        from: "user",
                        type: "5",
                        body: "",
                        error: !1
                    };
                    H = L.data.msg.log.length,
                        L.data.msg.log.push(a),
                        A.wx.chooseImage({
                            count: 1,
                            sizeType: ["original"],
                            sourceType: ["album", "camera"],
                            success: function(a) {
                                console.log(a),
                                    console.time("uploadWx");
                                var c = a.localIds[0];
                                A.wx.uploadImage({
                                    localId: a.localIds[0],
                                    isShowProgressTips: 1,
                                    success: function(a) {
                                        if (console.log(a), "uploadImage:ok" !== a.errMsg) return Q(),
                                            !1;
                                        var g = a.serverId;
                                        h.get({
                                            mediaId: g,
                                            auth: L.auth
                                        }).$promise.then(function(a) {
                                                L.imgUrl = c,
                                                    L.saveName = a.savename,
                                                    L.data.msg.log[H] = {
                                                        from: "user",
                                                        type: "2",
                                                        body: c
                                                    },
                                                    L.send("2", H),
                                                    W = !1,
                                                    console.timeEnd("uploadWx"),
                                                    console.log("savename:" + a.savename)
                                            },
                                            function() {
                                                Q()
                                            })
                                    },
                                    fail: Q
                                })
                            },
                            cancel: G
                        })
                }
            } else L.uploader,
                L.fileUpload = {
                    uploadCb: function(a) {
                        if (L.isUploadImg = !1, console.timeEnd("uploadAjax"), "null" == a) {
                            var c = {
                                from: "user",
                                type: "403"
                            };
                            return L.data.msg.log[H] = c,
                                !1
                        }
                        L.imgUrl = a.url,
                            L.saveName = a.savename,
                            L.send("2", H),
                            L.data.msg.log[H] = {
                                from: "user",
                                type: "2",
                                body: a.url
                            }
                    },
                    onError: function() {
                        L.isUploadImg = !1;
                        var a = {
                            from: "user",
                            type: "403"
                        };
                        L.data.msg.log[H] = a
                    },
                    onAdd: function(a) {
                        var c = {
                            from: "user",
                            type: "5",
                            body: a.queue[length],
                            error: !1
                        };
                        H = L.data.msg.log.length,
                            L.data.msg.log.push(c),
                            a.uploadAll(),
                            console.time("uploadAjax"),
                            L.isUploadImg = !0
                    }
                };
            L.$watch("data.msg.log.length",
                function() {
                    L.scrollBottom()
                }),
                L.scrollBottom = function() {
                    k(function() {
                            M.scrollTop(M[0].scrollHeight)
                        },
                        50)
                },
                L.set = [],
                L.audioPlay = function(a, c) {
                    var h = "#audio" + a,
                        g = angular.element(document.querySelector(h))[0];
                    if (L[c][a] = 0, g.paused) {
                        for (var y = angular.element(document.querySelectorAll("audio")), m = 0; m < y.length; m++) {
                            var v = y[m],
                                w = v.id.slice(5);
                            try {
                                v.pause(),
                                    v.currentTime = 0
                            } catch(e) {}
                            v.getAttribute("setaudio") ? L.set[w] = 0 : L.his[w] = 0
                        }
                        return g.play(),
                            void(L[c][a] = 1)
                    }
                    try {
                        g.pause(),
                            g.currentTime = 0
                    } catch(e) {}
                },
                L.$on("notification",
                    function(a, c) {
                        var h = c.idx;
                        k(function() {
                            L.set[h] = c.value
                        })
                    }),
                L.his = [],
                L.$on("historyaudio",
                    function(a, c) {
                        var h = c.idx;
                        k(function() {
                            L.his[h] = c.value
                        })
                    }),
                L.$parent.myScrollOptions = {
                    wrapper: {
                        snap: !1,
                        onScrollEnd: function() {
                            alert("finshed scrolling wrapper")
                        }
                    }
                };
            var V = function(a, c, h) {
                    var g = h.desc || h;
                    I.alert(g),
                        L.data.msg.log[a].error = !0,
                    2 == c && (L.data.msg.log[a].type = 403)
                },
                j = function(a) {
                    L.imgUrl = "",
                        L.saveName = "",
                        L.tip = !0,
                        L.data.msg.log[a].ioBusy = !1
                };
            L.send = function(a, c) {
                if (L.speak || L.imgUrl) {
                    if ("3" == L.data.msg.status) return void I.alert("当前问诊已结束",
                        function() {
                            b.path("/history").replace()
                        });
                    if (1 == a) {
                        var h = angular.element(document.querySelector("#tellMe"))[0];
                        h.blur();
                        var g = {
                            from: "user",
                            type: a,
                            body: L.speak,
                            error: !1
                        };
                        g.ioBusy = !0,
                            L.data.msg.log.push(g);
                        var y = L.speak;
                        L.speak = ""
                    } else var y = L.saveName;
                    P.send.post({
                            body: y,
                            type: a,
                            docid: L.docid,
                            chatid: L.chatId,
                            pid: N
                        },
                        function(h) {
                            var y = g ? L.data.msg.log.indexOf(g) : c;
                            if (h.code && 200 !== h.code) {
                                var v = h.msg ? h.msg: "发送失败，请重试";
                                V(y, a, v)
                            }
                            j(y)
                        },
                        function(h) {
                            var y = g ? L.data.msg.log.indexOf(g) : c,
                                v = h.data ? h.data.msg: "发送失败，请重试";
                            V(y, a, v),
                                j(y)
                        })
                }
            },
                a.get({
                    position: 2
                }).$promise.then(function(a) {
                    var c = a.msg.list;
                    L.adList = c;
                    var h = 1,
                        g = L.adList.length,
                        y = 3e3;
                    L.adWidth = document.documentElement.getBoundingClientRect().width,
                    g > 1 && k(function v() {
                            h >= g && (h = 0);
                            var a = -100 / g * h;
                            L.adtrans = "translateX(" + a + "%)",
                                h += 1,
                                k(v, y)
                        },
                        y)
                })
        }]),
    angular.module("myApp").config(["$stateProvider", "$urlRouterProvider",
        function(a) {
            a.state("home.historyChat", {
                url: "/history?pid&isHideNav&patientName",
                controller: "HistoryChatCtrl",
                resolve: {
                    data: ["Chat", "ipCookie", "$stateParams",
                        function(a, c, h) {
                            var g = c("docid");
                            return a.history.get({
                                docid: g,
                                page: 1,
                                pid: h.pid
                            }).$promise
                        }],
                    money: ["PayWayCheck", "ipCookie", "$stateParams",
                        function(a, c) {
                            var h = c("docid");
                            return a.get({
                                docid: h
                            }).$promise
                        }],
                    uploaderType: ["$ocLazyLoad",
                        function(a) {
                            a.load("/Public/mobile/css/module/chat_192d606.css")
                        }],
                    loadJs: ["$ocLazyLoad",
                        function(a) {
                            return a.load({
                                name: "HistoryChatCtrl",
                                files: ["//mcdn.anxinyisheng.com/Public/mobile/js/directive/payment_b914518.js"]
                            })
                        }]
                },
                templateUrl: "./partials/history.html"
            }).state("home.chatList", {
                url: "/chatList?docid&auth",
                plain: !0,
                resolve: {
                    check: function() {},
                    chatList: ["ChatList", "$stateParams",
                        function(a, c) {
                            return a.get({
                                docid: c.docid
                            }).$promise
                        }]
                },
                controller: "ChatListCtrl",
                templateUrl: "./partials/chatList.html"
            })
        }]),
    angular.module("myApp.controllers").controller("HistoryChatCtrl", ["$scope", "$state", "data", "$location", "checkGoChat", "$anchorScroll", "Chat", "ipCookie", "Img", "$timeout", "$window", "$stateParams", "money", "$localStorage",
        function(a, c, h, g, y, v, w, $, b, I, C, S, L, P) {
            h.first = !0,
                a.info = h,
                a.dataList = [h];
            var T = S.pid;
            if (angular.element(document.querySelector(".mainContent")), a.info.log && 0 != a.info.log.length) {
                var A = {
                    type: "8",
                    count: a.info.count
                };
                "1" != a.info.type && (A.from = "doc"),
                    a.info.log.unshift(A);
                for (var k = 0; k < a.info.log.length; k++) a.info.log[k].curPage = 1
            }
            a.docid = $("docid"),
            P["docid_" + a.docid] && P["docid_" + a.docid].name && (a.docIcon = P["docid_" + a.docid].icon),
                a.auth = $("auth"),
                a.page = 1,
                a.set = [],
                C.lib.flexible.rem2px(1.38),
                a.isHideNav = !!S.isHideNav,
                a.isHideNav ? I(function() {
                            var a = angular.element(document.querySelector(".mainContent"))[0].scrollHeight;
                            angular.element(document.querySelector(".mainContent")).scrollTop(a)
                        },
                        50) : y(a, c, {
                        docId: a.docid,
                        suc: function(c) {
                            a.payInfo = {
                                auth: a.auth,
                                docid: a.docid,
                                initCoupon: S.couponEntityId || "",
                                chatFee: c.price
                            },
                                a.isShowPayment = !0,
                                I(function() {
                                        window.scrollTo(0, window.innerHeight)
                                    },
                                    200)
                        }
                    }),
                a.audioPlay = function(c) {
                    var h = "#audio" + c,
                        g = angular.element(document.querySelector(h))[0];
                    if (a.set[c] = 0, g.paused) {
                        for (var y = angular.element(document.querySelectorAll("audio")), m = 0; m < y.length; m++) {
                            var v = y[m],
                                w = v.id.slice(5);
                            try {
                                v.pause(),
                                    v.currentTime = 0
                            } catch(e) {}
                            a.set[w] = 0
                        }
                        return g.play(),
                            void(a.set[c] = 1)
                    }
                    try {
                        g.pause(),
                            g.currentTime = 0
                    } catch(e) {}
                },
                a.$on("notification",
                    function(c, h) {
                        var g = h.idx;
                        I(function() {
                            a.set[g] = h.value
                        })
                    }),
                a.open = function(a) {
                    b.alert(a)
                },
                a.more = function() {
                    a.page++,
                        w.history.get({
                                docid: a.docid,
                                page: a.page,
                                pid: T
                            },
                            function(c) {
                                c.log.unshift(1 == c.type ? {
                                        type: "8",
                                        body: c.mt,
                                        count: c.count
                                    }: {
                                        type: "8",
                                        body: c.mt,
                                        count: c.count,
                                        from: "doc"
                                    });
                                for (var i = 0; i < c.log.length; i++) c.log[i].curPage = a.page;
                                a.dataList.unshift(c)
                            })
                }
        }]).controller("ChatListCtrl", ["ipCookie", "$location", "$scope", "chatList", "Chat", "$state", "ParseDate",
        function(a, c, h, g, y, v, w) {
            h.auth = a("auth"),
                h.docid = a("docid"),
                h.chatList = g.msg.patients;
            for (var $ = new Date,
                     b = $.getFullYear() + "/" + ($.getMonth() + 1) + "/" + $.getDate(), i = 0; i < h.chatList.length; i++) {
                var I = 1e3 * Number(h.chatList[i].mt);
                h.chatList[i].mt = I > new Date(b).getTime() ? w(I).slice(10, -3) : w(I).replace(/-/g, "/").slice(0, -9),
                    h.chatList[i].orderMt = 0 - I
            }
            h.goHistory = function(c, h) {
                y.exist.get({
                        docid: a("docid")
                    },
                    function(g) {
                        "1" == g.msg.status && g.msg.pid == c ? v.go("home.chat", {
                                docid: a("docid"),
                                auth: a("auth"),
                                pid: c
                            }) : v.go("home.historyChat", {
                                pid: c,
                                isHideNav: !0,
                                patientName: h
                            })
                    })
            }
        }]),
    angular.module("myApp").config(["$stateProvider", "$urlRouterProvider",
        function(a) {
            a.state("home.apptLite", {
                url: "/apptLite?docid&auth&wx",
                controller: "apptLite",
                level: 30,
                resolve: {
                    doctor: ["Doctor", "$stateParams", "ipCookie", "$http", "$localStorage",
                        function(a, c, h, g, y) {
                            var v = c.docid || h("docid");
                            return y["docid_" + v] && y["docid_" + v].name ? {
                                    msg: y["docid_" + v]
                                }: a.info.get({
                                    _id: v
                                }).$promise
                        }],
                    apptLiteInfo: ["ipCookie", "$stateParams", "CacheInfo", "Doctor",
                        function(a, c, h, g) {
                            var y = c.docid || a("docid");
                            return h.get(["lightSchedule_" + y]) ? h.get(["lightSchedule_" + y]) : g.lightSchedule.get({
                                    docId: y
                                }).$promise
                        }]
                },
                templateUrl: "./partials/apptLite.html"
            }).state("home.apptOrderList", {
                url: "/apptOrderList?auth&wx",
                controller: "apptOrderList",
                templateUrl: "./partials/apptOrderList.html"
            }).state("home.apptOrderDetail", {
                url: "/apptOrderDetail?appointId&auth&wx&type",
                controller: "apptOrderDetail",
                resolve: {
                    apptOrderDetail: ["ApptOrderDetail", "$stateParams", "ElizaApptOrderDetail",
                        function(a, c, h) {
                            return console.log(c.type),
                                console.log(/QUEEN*/g.test(c.type)),
                                /QUEEN*/g.test(c.type) ? h.get({
                                        queenAppointId: c.appointId
                                    }).$promise: a.get({
                                        appointId: c.appointId
                                    }).$promise
                        }],
                    supportDate: ["$ocLazyLoad",
                        function(a) {
                            a.load("/Public/mobile/css/page/apptOrderDetail_1ae130a.css")
                        }]
                },
                templateUrl: "./partials/apptOrderDetail.html"
            })
        }]),
    angular.module("myApp.controllers").controller("apptLite", ["$scope", "$state", "$location", "$stateParams", "$window", "ipCookie", "Alert", "Confirm", "ApptLiteSub", "doctor", "apptLiteInfo", "ParseDate", "DateWithWeek", "CacheInfo",
        function(a, c, h, g, y, v, w, $, b, I, C, S, L, P) {
            a.doctor = I.msg,
                a.isNewAppt = !0,
                a.lightSchedule = C.msg.list,
                a.isOn = P.get("isOnLightAppoint"),
                a.lightSchedule[0].weekShowName = "今天";
            var T = C.msg;
            T.serverTime > T.amEt && (a.lightSchedule[0].amIsDisable = 1),
            T.serverTime > T.pmEt && (a.lightSchedule[0].pmIsDisable = 1);
            for (var i = 1,
                     A = a.lightSchedule.length; A > i; i++) a.lightSchedule[i].weekShowName = "星期" + a.lightSchedule[i].weekName;
            a.$watch("isNewAppt",
                function() {
                    a.canSubmit = !!a.isNewAppt
                }),
                a.curTime,
                a.choose = function(c, h) {
                    a.curWeek = c,
                        a.curTime = h
                };
            var k = new Date,
                D = k.getDate();
            a.ioBusy = !1;
            var _ = function(c) {
                var h = c || "提交失败，请重试";
                w.alert(h),
                    a.ioBusy = !1
            };
            a.apptLite = function() {
                return a.curTime && a.curWeek ? a.ioBusy || !a.canSubmit ? !1 : (a.ioBusy = !0, void $.alert("医生确认后，请按照医院相关规定进行挂号，并到医院就诊", "温馨提示",
                            function() {
                                b.save({
                                    docid: I.msg._id,
                                    week: a.curWeek,
                                    timeTag: a.curTime
                                }).$promise.then(function(c) {
                                        if (200 === c.code) {
                                            a.isNewAppt = !1,
                                                a.ioBusy = !1;
                                            var h = "am" == a.curTime ? "上午": "下午",
                                                g = S(1e3 * Number(c.msg.st)).slice(0, 10).replace(/-/g, "/").slice(8);
                                            return a.liteDate = g == D ? S(1e3 * Number(c.msg.st)).slice(0, 10).replace(/-/g, "/") + " 今天," + h: L(S(1e3 * Number(c.msg.st)).slice(0, 10).replace(/-/g, "/")) + "," + h,
                                                !1
                                        }
                                        _(c.msg)
                                    },
                                    function() {
                                        _()
                                    })
                            },
                            function() {
                                a.ioBusy = !1
                            })) : !1
            },
                a.returnWx = y.wx.closeWindow
        }]).controller("apptOrderList", ["$scope", "$state", "$location", "$stateParams", "$window", "ipCookie", "Alert", "ParseDate", "ApptOrderList", "CacheInfo",
        function(a, c, h, g, y, v, w, $, b, I) {
            var C = ["日", "一", "二", "三", "四", "五", "六"];
            a.docid = v("docid"),
                a.auth = v("auth");
            var S = function(a) {
                    for (var i = 0; i < a.length; i++) if (a[i].subtime = $(1e3 * Number(a[i].ct)).slice(0, 16), a[i].st) {
                        var c = 1e3 * Number(a[i].st),
                            h = $(c).slice(5, 10).replace(/-/g, "/"),
                            g = new Date(c).getDay();
                        a[i].showTime = a[i].datetimeTag ? h + " 周" + C[g] + "，" + a[i].datetimeTag: h + " 周" + C[g] + "，" + $(c).slice(11, 16)
                    } else a[i].showTime = "未确认预约时间";
                    return a
                },
                L = function(c) {
                    a.apptlists = c,
                        a.hasData = !!a.apptlists[0],
                        a.isLoading = !1
                },
                P = function() {
                    a.hasData = !1,
                        a.isLoading = !1
                };
            return a.isLoading = !0,
                a.apptlists = [],
                I.get("apptLiteList") ? (L(I.get("apptLiteList")), !1) : void b.get({}).$promise.then(function(c) {
                            if (200 !== c.code) return P(),
                                !1;
                            var h = S(c.msg.list);
                            L(h),
                                I.set("apptLiteList", a.apptlists)
                        },
                        P)
        }]).controller("apptOrderDetail", ["$scope", "$state", "$location", "$stateParams", "$window", "ipCookie", "Alert", "ParseDate", "apptOrderDetail", "Toast", "cancleElizaAppt",
        function(a, c, h, g, y, v, w, $, b, I, C) {
            function S() {
                angular.element(document.querySelector("body")).css("overflow", "auto")
            }
            function L() {
                angular.element(document.querySelector("body")).css("overflow", "hidden")
            }
            if (a.auth = v("auth"), 200 !== b.code) return w.alert(b.msg,
                function() {
                    y.history.back()
                }),
                !1;
            if (a.apptInfo = b.msg, a.docid = a.apptInfo.docid, /QUEEN*/g.test(g.type) ? (a.ifEliza = "QUEEN", a.title = "安心名医一对一会诊", a.price = a.apptInfo.cashFee, a.deposit = a.apptInfo.deposit, a.refundFee = a.apptInfo.refundFee, a.past = a.apptInfo.st - CONFIG.serverTime > 86400 ? !0 : !1) : (a.ifEliza = "DOCTOR", a.title = "预约门诊"), !a.apptInfo.st) return a.apptInfo.showTime = "未确认预约时间",
                !1;
            var P = ["日", "一", "二", "三", "四", "五", "六"],
                T = 1e3 * Number(a.apptInfo.st),
                A = $(T).slice(5, 10).replace(/-/g, "/"),
                k = new Date(T).getDay();
            a.apptInfo.showTime = a.apptInfo.datetimeTag ? A + " 周" + P[k] + "，" + a.apptInfo.datetimeTag: A + " 周" + P[k] + "，" + $(T).slice(11, 16),
                a.ifcover = !1,
                a.cancleAppt = function() {
                    a.ifcover = !0,
                        L()
                },
                a.cancle = function() {
                    a.ifcover = !1,
                        S()
                },
                a.reasonArr = ["有事去不了", "距离太远", "我想选择其他医院", "下错单了", "其他"];
            var D;
            a.getvalue = function(x) {
                D = a.reasonArr[x]
            },
                a.ioBusy = !1,
                a.confirm = function() {
                    return a.ioBusy ? !1 : (a.ioBusy = !0, void(D ? C.save({
                                queenAppointId: g.appointId,
                                reason: D
                            }).$promise.then(function(c) {
                                200 == c.code ? (a.ifcover = !1, S(), I.alert("取消成功",
                                        function() {
                                            y.location.href = y.location.href + Math.random()
                                        })) : I.alert(c.msg)
                            }) : I.alert("请选择取消原因")))
                }
        }]),
    angular.module("myApp").config(["$stateProvider", "$urlRouterProvider",
        function(a) {
            a.state("home.apptVip", {
                url: "/apptVip?docid&auth&wx&from&to&prefrom",
                controller: "apptVip",
                level: 30,
                resolve: {
                    data: ["ipCookie", "$stateParams", "$http",
                        function(a, c) { !! c.auth && a("auth", c.auth)
                        }],
                    doctor: ["Doctor", "$stateParams", "ipCookie", "$localStorage",
                        function(a, c, h, g) {
                            var y = c.docid || h("docid");
                            return g["docid_" + y] && g["docid_" + y].name && "isMingYi" in g["docid_" + y] ? {
                                    msg: g["docid_" + y]
                                }: a.info.get({
                                    _id: y
                                }).$promise
                        }],
                    apptList: ["ApptList", "$stateParams", "ipCookie",
                        function(a, c, h) {
                            var g = c.docid || h("docid"),
                                y = {
                                    docid: g
                                };
                            return y.from = c.from,
                                y.to = c.to,
                                y.prefrom = c.prefrom,
                                a.post(y).$promise
                        }],
                    apptPrice: ["ipCookie", "$stateParams", "CacheInfo", "ApptPrice",
                        function(a, c, h, g) {
                            var y = c.docid || a("docid");
                            return h.get(["vipPrice_" + y]) ? h.get(["vipPrice_" + y]) : g.post({
                                    docid: y
                                }).$promise
                        }],
                    Patient: ["Patient",
                        function(a) {
                            return a.get().$promise
                        }]
                },
                templateUrl: "./partials/apptVip.html"
            }).state("home.apptVipAlert", {
                parent: "home.apptVip",
                url: "/apptVip.alert"
            })
        }]),
    angular.module("myApp.controllers").controller("apptVip", ["Toast", "DateWithWeek", "$scope", "$state", "$localStorage", "$location", "$stateParams", "ipCookie", "doctor", "Alert", "$window", "apptList", "apptPrice", "CheckAppt", "CacheInfo", "Patient", "payAction", "UpdateApptMobile", "makeHistory", "$timeout",
        function(a, c, h, g, y, v, w, $, b, I, C, S, L, P, T, A, k, D, _, N) {
            if (h.mobile = A.msg.mobile, h.focusVip = function() {
                    angular.element(document.querySelector("#mobile"))[0].focus()
                },
                    h.doctor = b.msg, 200 !== S.code) return I.alert(S.msg,
                function() {
                    C.history.back()
                }),
                !1;
            var O = 9;
            h.subsidyPrice = Number(L.msg.subsidyPrice),
                h.saleMoney = Number(L.msg.saleMoney);
            var E = Number(L.msg.basePrice) - h.saleMoney;
            h.price = 0 > E ? 0 : E,
                h.origPrice = h.doctor.isEliza ? 200 : h.subsidyPrice + Number(L.msg.basePrice),
                h.apptList = S.msg,
                h.hasSchedules = !1,
                h.chatTime = 15;
            var M = [];
            h.noAmount = !1;
            for (var z = 0; z < h.apptList.length; z++) if (M.push({
                    hasData: 0
                }), h.apptList[z].hasSchedule) {
                for (var R = h.apptList[z].times, B = R.length, F = 0; B > F; F++) ! M[z].hasData && R[F].amount > 0 && (M[z] = {
                    hasData: 1,
                    dateId: z,
                    timeId: F
                }),
                    h.apptList[z].times[F].dateId = z;
                h.apptList[z].timesGroup = [];
                for (var m = 0; B > m; m += O) h.apptList[z].timesGroup.push(R.slice(m, m + O));
                h.apptList[z].dateId = z
            }
            for (var U = [], H = [], m = 0; m < M.length; m++) M[m].hasData <= 0 ? U.push(m) : H.push(m);
            U.length >= M.length && (h.noAmount = !0);
            for (var i = 0; i < M.length; i++) if (M[i].hasData) {
                var W = M[i];
                h.cur = h.apptList[W.dateId],
                    h.curTime = h.cur.times[W.timeId],
                    h.timesShow = h.cur.timesGroup[parseInt(W.timeId / O)],
                    h.hasSchedules = !0;
                break
            }
            if (!h.cur) for (var i = 0; i < h.apptList.length; i++) if (h.apptList[i].hasSchedule) {
                h.cur = h.apptList[i],
                    h.timesShow = h.cur.timesGroup[0],
                    h.hasSchedules = !0;
                break
            }
            h.noTime = !1,
                h.chooseDay = function(a) {
                    if (h.cur.dateId == a) return ! 1;
                    var c = M[a];
                    h.curTime = h.apptList[a].times[c.timeId],
                        h.cur = h.apptList[a];
                    for (var x = 0; x < U.length; x++) if (U[x] == a) return void(h.noTime = !0);
                    h.noTime = !1
                },
                h.chooseTime = function(a, c) {
                    if (a.amount <= 0) return ! 1;
                    var g = (h.curSlideIndex - 1) * O + c;
                    h.curTime = h.apptList[a.dateId].times[g]
                },
                h.$watch("cur",
                    function() {
                        if (h.cur) {
                            var a = M[h.cur.dateId].timeId,
                                c = a ? parseInt(a / O) : 0;
                            h.timesShow = h.cur.timesGroup[c];
                            var g = h.cur.times.length;
                            h.showRightHandle = !!(g > O),
                                h.showLeftHandle = c > 0,
                                h.curIndexAll = Math.ceil(g / O),
                                h.curSlideIndex = c + 1
                        }
                    }),
                h.$watch("curTime",
                    function() {
                        h.canSubmit = !!h.curTime,
                        h.curTime && (h.chatTime = (h.curTime.et - h.curTime.st) / 60 || 15),
                        h.curTime && (h.curTimeForShow = c(h.cur.date) + " " + Q(h.curTime.st))
                    }),
                h.slide = function(a) {
                    "left" === a ? h.curSlideIndex -= 1 : h.curSlideIndex += 1,
                        h.timesShow = h.cur.timesGroup[h.curSlideIndex - 1],
                        h.showLeftHandle = !(1 == h.curSlideIndex),
                        h.showRightHandle = !(h.curSlideIndex == h.curIndexAll)
                };
            var G = function(a) {
                    return parseInt(a, 10) >= 10 ? "" + a: "0" + a
                },
                Q = function(a) {
                    var c = new Date(1e3 * parseInt(a));
                    return G(c.getHours()) + ":" + G(c.getMinutes())
                },
                V = _({
                    name: "/apptVip",
                    alertName: "alert",
                    callback: function() {
                        N(function() {
                            h.timebox = !1,
                                h.isShowPolicy = !1
                        })
                    }
                });
            h.timebox = !1,
                h.curTimeFlag = !1;
            var j = {};
            h.selectT = function() {
                h.timebox = !0,
                    j = {
                        cur: angular.copy(h.cur),
                        curTime: angular.copy(h.curTime)
                    },
                    V.make()
            },
                h.close = function() {
                    h.timebox = !1,
                        h.noTime = !1,
                        h.cur = j.cur,
                        h.curTime = j.curTime,
                        N(function() {
                                if (h.curTime) {
                                    for (var a = 0,
                                             i = 0; i < h.cur.times.length; i++) if (h.cur.times[i].scheduleId == h.curTime.scheduleId) {
                                        a = i;
                                        break
                                    }
                                    var c = a ? parseInt(a / O) : 0;
                                    h.timesShow = h.cur.timesGroup[c],
                                        h.curSlideIndex = c + 1,
                                        h.showLeftHandle = !(1 == h.curSlideIndex),
                                        h.showRightHandle = !(h.curSlideIndex == h.curIndexAll)
                                }
                            },
                            20),
                        V.back()
                },
                h.selectOk = function() {
                    return h.curTime ? (h.timebox = !h.timebox, h.curTimeFlag = !0, void V.back()) : !1
                },
                h.isIoBusy = !1;
            var Y = function() {
                    if (h.isIoBusy) return ! 1;
                    h.isIoBusy = !0;
                    var a = h.curTime.scheduleId;
                    P.post({
                        scheduleId: a,
                        docid: h.doctor._id,
                        userMobile: h.mobile
                    }).$promise.then(function(a) {
                        if (200 === a.code) h.appointId = a.msg.appointId,
                            h.mobile !== A.msg.mobile ? D.post({
                                    userMobile: h.mobile,
                                    appointId: h.appointId
                                }).$promise.then(function(a) {
                                    200 === a.code ? J() : I.alert("手机号更新失败，请重试")
                                }) : J();
                        else {
                            var c = a.msg.desc || a.msg;
                            I.alert(c),
                                h.isIoBusy = !1
                        }
                    })
                },
                J = function() {
                    var a = {
                        docid: b.msg._id,
                        money: h.price,
                        auth: $("auth"),
                        appointId: h.appointId
                    };
                    k(h, g, a, {
                        type: 5,
                        suc: function() {
                            v.path("/feedbackSuc").search({
                                msg: "您已预约成功",
                                msg_small: "请您注意查收预约确认短信",
                                icon: "suc"
                            }).replace()
                        },
                        fail: function() {
                            h.isIoBusy = !1
                        }
                    })
                };
            h.pay = function() {
                return h.curTimeFlag ? h.mobile ? /^1\d{10}$/gi.test(h.mobile) ? void Y() : (a.alert("请正确填写手机号码"), !1) : (a.alert("联系方式不能为空"), !1) : (a.alert("请选择预约时间"), !1)
            },
                h.isEliza = !1,
                h.showPolicy = function() {
                    h.isShowPolicy = !0,
                        V.make()
                },
                h.closePolicy = function() {
                    h.isShowPolicy = !1,
                        V.back()
                },
                h.changeout = function() {
                    h.btnstyle = {
                        position: "fixed",
                        bottom: "0"
                    }
                },
                h.changeinto = function() {
                    h.btnstyle = {
                        position: "static"
                    }
                }
        }]),
    angular.module("myApp").config(["$stateProvider", "$urlRouterProvider",
        function(a) {
            a.state("home.apptCall", {
                url: "/apptCall?docid&auth&wx&reg",
                controller: "apptCall",
                level: 30,
                resolve: {
                    data: ["ipCookie", "$stateParams", "$http",
                        function(a, c) { !! c.auth && a("auth", c.auth)
                        }],
                    doctor: ["Doctor", "$stateParams", "ipCookie", "$localStorage",
                        function(a, c, h, g) {
                            var y = c.docid || h("docid");
                            return g["docid_" + y] && g["docid_" + y].name && "isMingYi" in g["docid_" + y] ? {
                                    msg: g["docid_" + y]
                                }: a.info.get({
                                    _id: y
                                }).$promise
                        }],
                    callList: ["CallList", "$stateParams", "ipCookie",
                        function(a, c, h) {
                            var g = c.docid || h("docid");
                            return a.post({
                                docid: g
                            }).$promise
                        }],
                    patient: ["Patient",
                        function(a) {
                            return a.get().$promise
                        }]
                },
                templateUrl: "./partials/apptCall.html"
            }).state("home.apptCallAlert", {
                parent: "home.apptCall",
                url: "/apptCall.alert"
            })
        }]),
    angular.module("myApp.controllers").controller("apptCall", ["UpdateCallMobile", "CacheInfo", "Toast", "ParseDate", "$scope", "$state", "$localStorage", "$location", "$stateParams", "ipCookie", "doctor", "Alert", "$window", "callList", "CheckCall", "patient", "DateWithWeek", "payAction", "makeHistory", "$timeout",
        function(a, c, h, g, y, v, w, $, b, I, C, S, L, P, T, A, k, D, _, N) {
            if (y.mobile = A.msg.mobile, y.focusCall = function() {
                    angular.element(document.querySelector("#mobile"))[0].focus()
                },
                    y.doctor = C.msg, 200 !== P.code) return S.alert(P.msg,
                function() {
                    L.history.back()
                }),
                !1;
            var O = P.msg;
            y.price = O.price,
                y.callLong = 15,
                y.callList = O,
                y.todayTag = g(1e3 * parseInt(O.serverTime)).slice(0, 10),
                y.tomorrowTag = g(1e3 * parseInt(O.serverTime) + 864e5).slice(0, 10),
                y.todayText = y.todayTag.replace(/-/gi, "/"),
                y.tomorrowText = y.tomorrowTag.replace(/-/gi, "/"),
                y.isToday = !0,
                y.curDay = y.todayTag;
            var E = function(a) {
                y.curTime = "am",
                O.serverTime > O.amEndTime && (y.isOveram = !0, y.curTime = "pm"),
                O.serverTime > O.pmEndTime && (y.isOverpm = !0, y.curTime = "nt"),
                O.serverTime > O.ntEndTime && (y.isOvernt = !0, a ? (y.isToday = !1, y.curTime = "am", y.curDay = y.tomorrowTag) : y.curTime = "")
            };
            E(!0),
                y.$watch("curDay",
                    function() {
                        y.todayTag == y.curDay ? E() : y.curTime = "am"
                    }),
                y.$watch("curTime",
                    function() {
                        y.curTimeInput = "am" == y.curTime ? "上午": "pm" == y.curTime ? "下午": "晚上",
                            y.curWeek = y.curDay == y.todayTag ? y.todayText + " (今天)": y.tomorrowText + "(" + k(y.curDay).slice(10) + ")"
                    }),
                y.chooseTime = function(a, c) {
                    return a ? !1 : void(y.curTime = c)
                },
                y.changeDay = function(a) {
                    y.curDay = a,
                        y.isToday = !(y.todayTag != a)
                };
            var M = function(a) {
                    a && S.alert(a),
                        y.ioBusy = !1
                },
                z = _({
                    name: "/apptCall",
                    alertName: "alert",
                    callback: function() {
                        N(function() {
                            y.timeFlag = !1
                        })
                    }
                });
            y.timeFlag = !1,
                y.timeFlagT = !1;
            var R = {};
            y.selectT = function() {
                y.timeFlag = !0,
                    R = {
                        curDay: angular.copy(y.curDay),
                        curTime: angular.copy(y.curTime)
                    },
                    z.make()
            },
                y.close = function() {
                    y.timeFlag = !1,
                        y.curDay = R.curDay,
                        N(function() {
                                y.curTime = R.curTime
                            },
                            20),
                        z.back()
                },
                y.selectOk = function() {
                    return y.curTime ? (y.timeFlag = !1, y.timeFlagT = !0, void z.back()) : !1
                };
            var B, F = function() {
                    return y.ioBusy ? !1 : (y.ioBusy = !0, void T.get({
                            docid: C.msg._id,
                            dateTag: y.curDay,
                            timeTag: y.curTime
                        }).$promise.then(function(c) {
                                return 200 === c.code ? (B = c.msg.callId, y.mobile !== A.msg.mobile ? a.post({
                                            mobile: y.mobile,
                                            callId: B
                                        }).$promise.then(function(a) {
                                            200 === a.code ? U() : M("手机号更新失败，请重试")
                                        }) : U(), !1) : void M(c.msg)
                            },
                            function() {
                                M()
                            }))
                },
                U = function() {
                    var a = {
                        docid: C.msg._id,
                        money: y.price,
                        auth: I("auth"),
                        callId: B
                    };
                    D(y, v, a, {
                        type: 6,
                        suc: function() {
                            $.path("/feedbackSuc").search({
                                msg: "您已成功提交预约",
                                msg_small: "具体时间请耐心等待医生确认",
                                icon: "suc"
                            }).replace()
                        },
                        fail: function() {
                            y.ioBusy = !1
                        }
                    })
                };
            y.ioBusy = !1,
                y.pay = function() {
                    return y.timeFlagT ? y.mobile ? /^1\d{10}$/gi.test(y.mobile) ? void F() : (h.alert("请正确填写手机号码"), !1) : (h.alert("接听电话不能为空"), !1) : (h.alert("请选择一个时间段"), !1)
                }
        }]),
    angular.module("myApp").config(["$stateProvider", "$urlRouterProvider",
        function(a) {
            a.state("home.couponlist", {
                url: "/couponlist?auth&wxId",
                controller: "couponlist",
                resolve: {
                    doctorCount: ["DoctorCount", "$stateParams",
                        function(a) {
                            return a.get({}).$promise
                        }]
                },
                templateUrl: "./partials/couponlist.html"
            }).state("home.couponPolicy", {
                url: "/couponPolicy",
                templateUrl: "./partials/couponPolicy.html"
            })
        }]),
    angular.module("myApp.controllers").controller("couponlist", ["$state", "$scope", "ipCookie", "$location", "$stateParams", "Alert", "Couponlist", "Chat", "PayWayCheck", "LastDoc", "doctorCount", "CacheInfo", "$window", "couponBizType",
        function(a, c, h, g, y, v, w, $, b, I, C, S, L, P) {
            return c.canuse = !0,
                c.changeTab = function(a) {
                    c.canuse = a
                },
                c.use = function(c) {
                    if (1 !== c.status) return ! 1;
                    var h = y.auth,
                        v = c.docInfo;
                    if (c.bizType !== P.qa_ask && c.bizType !== P.eliza) {
                        if (! (v && v._id || 200 !== C.code || 1 === C.msg.count)) return a.go("home.doctorList", {
                            auth: h,
                            couponEntityId: c.couponEntityId
                        }),
                            !1;
                        var w = v ? v._id: C.msg.docId;
                        a.go("home.doctor", {
                            id: w,
                            auth: h,
                            couponEntityId: c.couponEntityId
                        })
                    } else if (c.bizType == P.qa_ask) {
                        var $ = "couponEntityId=" + c.couponEntityId + "&from=biz_couponlist";
                        L.location.href = v ? "http://" + g.$$host + "/home/wx/toYdIndex?docid=" + v._id + "&" + $: "http://" + g.$$host + "/home/wx/toYd?" + $
                    } else if (c.bizType == P.eliza) {
                        var $ = "couponEntityId=" + c.couponEntityId + "&from=biz_couponlist";
                        L.location.href = "http://" + g.$$host + "/home/wx/toElizabethPromote?" + $
                    }
                },
                c.isLoading = !0,
                S.get("couponList") ? (c.lists = S.get("couponList"), c.isLoading = !1, !1) : void w.get({
                        type: 2
                    }).$promise.then(function(a) {
                            c.isLoading = !1,
                                c.lists = a.msg,
                                S.set("couponList", a.msg)
                        },
                        function() {
                            c.isLoading = !1,
                                c.lists = []
                        })
        }]),
    angular.module("myApp").config(["$stateProvider", "$urlRouterProvider",
        function(a) {
            a.state("home.refund", {
                url: "/refund?tradeNum",
                controller: "RefundCtrl",
                resolve: {
                    data: ["RefundOption",
                        function(a) {
                            return a.get().$promise
                        }]
                },
                templateUrl: "./partials/refund.html"
            })
        }]),
    angular.module("myApp.controllers").controller("RefundCtrl", ["$scope", "$state", "data", "ipCookie", "RefundSub", "Alert", "Notice", "$window",
        function(a, c, h, g, y, v, w, $) {
            if (a.hasUnSatData = !1, 200 !== h.code) return c.go("home.feedbackSuc", {
                msg: h.msg.desc,
                icon: "error"
            }),
                !1;
            a.hasUnSatData = !0,
                h = h.msg.reasons,
                a.refoundOpts = h,
                a.canSubmit = !1,
                a.isSelect = function(c) {
                    return ! (c !== a.curidx || a.hasText)
                },
                a.select = function(c) {
                    a.curidx = c.target.getAttribute("idx"),
                        a.type = c.target.getAttribute("type"),
                        a.canSubmit = !0
                };
            var b = !1;
            a.submit = function() {
                if (!a.canSubmit || b) return ! 1;
                b = !0;
                var h = {
                    tradeNum: c.params.tradeNum,
                    commentid: a.curidx
                };
                y.get(h,
                    function(a) {
                        200 === a.code ? w.alert(["感谢您对安心医生的信任", "我们会在2个工作日内审核您的申请"], "",
                                function() {
                                    $.history.back()
                                }) : (b = !1, v.alert(a.msg.desc))
                    })
            }
        }]),
    angular.module("myApp").config(["$stateProvider", "$urlRouterProvider",
        function(a) {
            a.state("home.reward", {
                url: "/reward?auth&wx&docid&from&chatId&bizid&qrInfo",
                controller: "reward",
                level: 30,
                resolve: {
                    doctor: ["Doctor", "$stateParams", "ipCookie", "$localStorage",
                        function(a, c, h, g) {
                            var y = c.docid || h("docid");
                            return g["docid_" + y] && g["docid_" + y].name && "isMingYi" in g["docid_" + y] ? {
                                    msg: g["docid_" + y]
                                }: a.info.get({
                                    _id: y
                                }).$promise
                        }],
                    from: ["$stateParams",
                        function(a) {
                            return /event/.test(a.from) ? a.from.split("event")[1] : "satisfied" == a.from ? 1 : 2
                        }],
                    rewards: ["Rewards", "from", "$stateParams", "doctor",
                        function(a, c, h, g) {
                            var y = h.chatId || h.bizid || g.msg._id;
                            return a.get({
                                from: c,
                                bizid: y,
                                docid: g.msg._id
                            }).$promise
                        }]
                },
                templateUrl: "./partials/reward.html"
            }).state("home.rewardAlert", {
                parent: "home.reward",
                url: "/reward.alert"
            }).state("home.shareGift", {
                url: "/shareGift?auth&wx&couponEntityId&from&bizid&name&type&id",
                controller: "shareGiftCtrl",
                templateUrl: "./partials/shareGift.html",
                resolve: {
                    loadGoShare: ["$ocLazyLoad",
                        function(a) {
                            return a.load({
                                name: "goShare",
                                files: ["//mcdn.anxinyisheng.com/Public/mobile/js/services/goShare_18316b9.js"]
                            })
                        }]
                }
            })
        }]),
    angular.module("myApp.controllers").controller("reward", ["$sce", "makeHistory", "$state", "$scope", "ipCookie", "$timeout", "$location", "$stateParams", "$window", "Alert", "payAction", "doctor", "rewards", "DocRewardsList", "from", "Toast", "bLength", "$rootScope",
        function(a, c, h, g, y, v, w, $, b, I, C, S, L, P, T, A, k) {
            g.now = (new Date).getTime(),
                g.doctor = S.msg,
                g.from = T,
                g.rewards = L.msg.goods,
                g.rewards_records = L.msg.goods,
                g.tipWord = "";
            var D = "谢谢医生，您辛苦了！";
            g.words = {
                text: D
            },
                g.showExamplePanel = !1,
                g.material = {
                    name: "",
                    text: [{
                        text: "医德高尚，医术精湛",
                        id: 0
                    },
                        {
                            text: "妙手扶桑梓，高医攀新峰",
                            id: 1
                        }]
                },
                g.curMaterial = 0;
            var _, N = "./img/reward/material_";
            g.$watch("curMaterial",
                function(a) {
                    g.curMaterialImgSmall = N + a + "_small.png?v=1"
                });
            var O = function() {
                g.showPanel = "Virtual";
                for (var a = "hasnotdefault",
                         i = 0; i < g.rewards.length; i++) if (Number(g.rewards[i]["default"])) {
                    a = i;
                    break
                }
                return "hasnotdefault" === a ? !1 : (g.curidx = g.rewards[a]._id, g.price = g.rewards[a].price, g.name = g.rewards[a].name, void(1 == g.rewards[a].type && (g.showPanel = "Material")))
            };
            O(),
                g.closeWx = function() {
                    b.wx.closeWindow()
                };
            var E = c({
                name: "/reward",
                alertName: "alert",
                callback: function() {
                    v(function() {
                        g.showExamplePanel = !1
                    })
                }
            });
            g.isDubble = !1;
            var M = function(a, c) {
                return a.getAttribute(c) ? a.getAttribute(c) : M(a.parentNode, c)
            };
            g.nameChange = function() {
                return F ? !1 : void(g.canSubmit = !!g.material.name)
            },
                g.chooseMaterialText = function(a) {
                    return F ? !1 : void(g.curMaterial = a)
                },
                g.select = function(a, c) {
                    if (F) return ! 1;
                    var h = a.target;
                    g.curidx = M(h, "idx"),
                        g.price = M(h, "price"),
                        g.name = M(h, "name"),
                        g.showPanel = c
                },
            1 == g.rewards.length && (g.curidx = g.rewards[0]._id, g.price = g.rewards[0].price, g.name = g.rewards[0].name),
                g.isSelect = function(a) {
                    return ! (a !== g.curidx)
                },
                g.close = function() {
                    E.back(),
                        g.showExamplePanel = !1
                };
            var z = function() {
                    var a = new Date,
                        c = a.getFullYear(),
                        h = a.getMonth() + 1,
                        g = h >= 10 ? "十": "",
                        y = h >= 10 ? 10 === h ? "": (h + "").slice(1, 2) : h,
                        v = function(a) {
                            return (a + "").replace(/\d/gi,
                                function(a) {
                                    var c;
                                    switch (Number(a)) {
                                        case 1:
                                            c = "一";
                                            break;
                                        case 2:
                                            c = "二";
                                            break;
                                        case 3:
                                            c = "三";
                                            break;
                                        case 4:
                                            c = "四";
                                            break;
                                        case 5:
                                            c = "五";
                                            break;
                                        case 6:
                                            c = "六";
                                            break;
                                        case 7:
                                            c = "七";
                                            break;
                                        case 8:
                                            c = "八";
                                            break;
                                        case 9:
                                            c = "九";
                                            break;
                                        case 0:
                                            c = "零";
                                            break;
                                        default:
                                            c = ""
                                    }
                                    return c
                                })
                        },
                        w = v(c) + "年" + g + v(y) + "月";
                    return function() {
                        return w
                    }
                } (),
                R = function(a, x, c, h) {
                    for (var i = 0; i < a.length; i++) _.fillText(a[i], x, c + i * h)
                },
                B = function() {
                    var a = window.lib.flexible.rem2px,
                        c = document.querySelector("canvas"),
                        h = a(11.2),
                        y = a(7.94);
                    return c.width = y,
                        c.height = h,
                        _ = c.getContext("2d"),
                        _.fillStyle = "#FFFB08",
                        _.font = "bold " + parseInt(a(.43)) + "px serif",
                        function() {
                            var c = g.material.name; (k(c) > 14 || !c || /[^\u4E00-\u9FA5]/gi.test(c)) && (c = "韩梅梅");
                            var v = {
                                date: z(),
                                name: c,
                                docName: "赠：" + g.doctor.name + "医生"
                            };
                            _.clearRect(0, 0, y, h),
                                R(v.docName, a(5.9), a(1.55), a(.6)),
                                R(v.name, a(2.2), a(4.95), a(.6)),
                                R(v.date, a(1.5), a(4.95), a(.6))
                        }
                } ();
            g.showExample = function() {
                g.curMaterialImg = N + g.curMaterial + ".png?v=1",
                    g.showExamplePanel = !0,
                    B(),
                    E.make()
            };
            var F = !1;
            console.log(g.curidx),
                g.pay = function(a, c) {
                    if (F) return ! 1;
                    if (!g.curidx) return A.alert("请先选择心意"),
                        !1;
                    g.isDubble = !!c;
                    var v = {
                        docid: S.msg._id,
                        money: g.price,
                        auth: y("auth"),
                        from: T,
                        goodsid: g.curidx,
                        amount: c || 1
                    };
                    if ("Material" === a) {
                        if (!g.material.name) return A.alert("请先填写姓名"),
                            !1;
                        if (/[^\u4E00-\u9FA5]/gi.test(g.material.name)) return A.alert("姓名只能输入中文"),
                            !1;
                        if (k(g.material.name) > 14) return A.alert("姓名不能超过7个字"),
                            !1;
                        v.goodsTitle = g.material.text[g.curMaterial].text,
                            v.goodsSign = g.material.name,
                            v.lwords = D
                    } else {
                        if (k(g.words.text) > 280) return A.alert("留言不能超过140个字"),
                            !1;
                        v.lwords = g.words.text
                    }
                    v.chatId = $.chatId || $.bizid,
                        F = !0,
                        console.log(v),
                        C(g, h, v, {
                            type: 4,
                            suc: function() {
                                F = !1;
                                var c = S.msg._id,
                                    h = S.msg.name;
                                w.path("/shareGift").search({
                                    name: h,
                                    type: a,
                                    icon: "suc",
                                    id: c
                                }).replace()
                            },
                            fail: function() {
                                F = !1
                            }
                        })
                };
            var U = 0;
            g.nomore = !1,
                g.rewards_records = [],
                g.rewards_records_total = 1,
                g.needFix = !1,
                g.more = function() {
                    if (g.rewards_records_loadding) return ! 1;
                    U++,
                        g.rewards_records_loadding = !0,
                        g.needFix = !1;
                    var c = $.chatId || $.bizid || S.msg._id;
                    P.get({
                        docid: S.msg._id,
                        page: U,
                        from: T,
                        bizid: c
                    }).$promise.then(function(c) {
                        g.rewards_records_total = c.msg.count,
                            v(function() {
                                g.rewards_records_loadding = !1,
                                    g.rewards_records = g.rewards_records.concat(c.msg.rewards),
                                (!c.msg.rewards[0] || c.msg.rewards.length < 10) && (g.nomore = !0),
                                g.tipWord || (g.tipWord = a.trustAsHtml(c.msg.tipWord))
                            })
                    })
                },
                g.more(),
                angular.element(document.querySelectorAll("#wrapper")),
                g.$watch("showExamplePanel",
                    function(a) {
                        document.ontouchmove = function() {
                            return ! a
                        }
                    })
        }]),
    angular.module("myApp.controllers").controller("shareGiftCtrl", ["$state", "$scope", "ipCookie", "$timeout", "$location", "$stateParams", "$window", "Alert", "Prompt", "goShare", "getHost",
        function(a, c, h, g, y, v, w, $, b, I, C) {
            wx.ready(function() {
                wx.showOptionMenu(),
                    wx.hideMenuItems({
                        menuList: ["menuItem:share:qq", "menuItem:share:weiboApp", "menuItem:share:QZone", "menuItem:share:facebook", "menuItem:originPage", "menuItem:readMode", "menuItem:openWithQQBrowser", "menuItem:openWithSafari", "menuItem:share:email", "menuItem:editTag", "menuItem:delete", "menuItem:copyUrl"]
                    })
            });
            var S = v.type,
                L = v.name;
            c.name = L,
                "Material" === S ? (c.isTitleShow = !0, c.isTitle = !1) : (c.isTitleShow = !1, c.isTitle = !0),
                c.showRecommendRewardRule = function(a) {
                    a.stopPropagation(),
                        b.alert("", "奖励规则", ["分享“医生页面”给您的朋友，每成功邀请一位新用户关注该医生，您可获得两张5折的一答提问券（最高优惠10元）；你的朋友成功关注医生后即可获得一张1元在线咨询券，仅需1元便可咨询三甲名医。", " ", "查询请点击微信菜单“更多服务”-“抵用券”"], "知道了",
                            function() {},
                            !0)
                },
                c.isShow = !1,
                c.showing = function() {
                    c.isShow = !0
                },
                c.hiding = function() {
                    c.isShow = !1
                },
                c.backed = function() {
                    w.wx.closeWindow()
                },
                I({
                        docId: v.id,
                        shareFrom: "biz_reward",
                        shareWxId: v.wx || h("wxid") || "",
                        shareAuth: v.auth || h("auth") || ""
                    },
                    {
                        title: "我推荐了一名安心好医生，Ta很专业",
                        desc: "微信咨询健康问题，就来「安心健康」",
                        link: C.host + "/home/wx/toInviteShareInfo",
                        imgUrl: "http://mcdn.anxinyisheng.com/Public/mobile/img/common/logo_share_f5d2ed7.png"
                    },
                    {
                        docId: v.id,
                        shareFrom: "biz_reward"
                    },
                    "doctorindex")
        }]),
    angular.module("myApp").config(["$stateProvider", "$urlRouterProvider",
        function(a) {
            a.state("home.unsatisfied", {
                url: "/unsatisfied?chatId&auth",
                controller: "UnsatisfiedCtrl",
                resolve: {
                    data: ["UnsatisfiedOption", "ipCookie", "$stateParams", "$http",
                        function(a, c, h) {
                            return c("auth", h.auth),
                                a.get({
                                    chatId: h.chatId,
                                    type: 2
                                }).$promise
                        }]
                },
                templateUrl: "./partials/unsatisfied.html"
            }).state("home.feedbackSuc", {
                url: "/feedbackSuc?msg&icon&msg_small",
                controller: "feedbackSucCtrl",
                templateUrl: "./partials/feedbackSuc.html"
            }).state("home.satisfied", {
                url: "/satisfied?auth&chatId&feeplace",
                controller: "satisfied",
                resolve: {
                    data: ["SatisfiedInfo", "ipCookie", "$stateParams", "$http",
                        function(a, c, h) {
                            return c("auth", h.auth),
                                a.get({
                                    chatId: h.chatId,
                                    type: 1
                                }).$promise
                        }]
                },
                templateUrl: "./partials/satisfied.html"
            }).state("home.refundPolicy", {
                url: "/refundPolicy",
                templateUrl: "./partials/refund_policy.html"
            })
        }]),
    angular.module("myApp.controllers").controller("UnsatisfiedCtrl", ["$scope", "$state", "$location", "data", "ipCookie", "UnsatisfiedSub", "Alert",
        function(a, c, h, g, y, v, w) {
            a.hasUnSatData = !1;
            var $ = window.CONFIG ? window.CONFIG.serviceNumber: "4000889128",
                b = '投诉电话：<a  class="serviceNumber" href="tel:' + $ + '">' + $.substring(0, 3) + "-" + $.substring(3, 7) + "-" + $.substring(7) + "</a><br>工作时间：周一至周五8:00~22:00";
            if (200 !== g.code) return h.path("/feedbackSuc").search({
                msg: g.msg.desc,
                icon: "caution",
                msg_small: b
            }).replace(),
                !1;
            a.hasUnSatData = !0,
                g = g.msg.commons,
                a.unsatisfiedOpts = g,
                a.canSubmit = !1,
                a.hasOpts = !1,
                a.hasText = !1,
                a.curidx = 0;
            var I = function() {
                a.canSubmit = a.hasOpts && !a.hasText || a.hasText && !a.hasOpts
            };
            a.isSelect = function(c) {
                return ! (c !== a.curidx || a.hasText)
            },
                a.select = function(c) {
                    a.curidx = c.target.getAttribute("idx"),
                        a.type = c.target.getAttribute("type"),
                        a.focusIn = !1,
                        a.hasText = !1,
                        a.hasOpts = !0,
                        I()
                },
                a.focus = function(c) {
                    a.focusIn = !0,
                        a.curidx = document.getElementById("textId").value,
                        a.hasOpts = !1,
                        a.hasText = c ? !0 : !1,
                        I()
                },
                a.textChange = function(c) {
                    console.log(c),
                        a.text = c,
                        a.curidx = document.getElementById("textId").value,
                        a.hasText = c ? !0 : !1,
                        I()
                };
            var C = !1;
            a.submit = function() {
                if (!a.canSubmit || C) return ! 1;
                C = !0;
                var g = {
                    chatId: c.params.chatId,
                    commentid: a.curidx,
                    type: a.type
                };
                v.get(g,
                    function(a) {
                        200 === a.code ? h.path("/feedbackSuc").search({
                                msg: "感谢您的反馈",
                                icon: "caution",
                                msg_small: b
                            }).replace() : w.alert(a.msg.desc),
                            C = !1
                    })
            }
        }]).controller("satisfied", ["$scope", "$state", "$localStorage", "$location", "$stateParams", "data", "ipCookie", "ParseDate", "Alert", "$window",
        function(a, c, h, g, y, v, w) {
            a.hasDocData = !1;
            var $ = window.CONFIG ? window.CONFIG.serviceNumber: "4000889128",
                b = '投诉电话：<a  class="serviceNumber" href="tel:' + $ + '">' + $.substring(0, 3) + "-" + $.substring(3, 7) + "-" + $.substring(7) + "</a><br>工作时间：周一至周五8:00~22:00";
            if (200 !== v.code) return g.path("/feedbackSuc").search({
                msg: v.msg.desc,
                icon: "caution",
                msg_small: b
            }).replace(),
                !1;
            v = v.msg;
            var I = v.doctorInfo.name;
            return 4 !== Number(c.params.feeplace) ? (g.path("/feedbackSuc").search({
                    msg: "感谢您对" + I + "医生本次服务的认可",
                    icon: "suc"
                }).replace(), !1) : (h["docid_" + v.doctorInfo._id] || (h["docid_" + v.doctorInfo._id] = v.doctorInfo), w("docid", v.doctorInfo._id), void g.path("/reward").search({
                    chatId: y.chatId,
                    from: "satisfied"
                }).replace())
        }]).controller("feedbackSucCtrl", ["$scope", "$state", "$window", "$sce",
        function(a, c, h, g) {
            a.msg = c.params.msg,
                a.msg_small = g.trustAsHtml(c.params.msg_small),
                a.icon = c.params.icon,
                a.close = h.wx.closeWindow
        }]),
    angular.module("myApp").config(["$stateProvider", "$urlRouterProvider",
        function(a) {
            a.state("home.goToPrePay", {
                url: "/goto_prepay?couponEntityId&wx&docid&price&auth&wxid",
                controller: "goToPrePayController",
                resolve: {
                    data: ["Couponlist", "ipCookie", "$stateParams",
                        function(a, c, h) {
                            var g = h.docid || c("docid");
                            return a.get({
                                type: 0,
                                docid: g,
                                biztype: 1e3
                            }).$promise
                        }],
                    doctor: ["Doctor", "$stateParams", "ipCookie", "$localStorage",
                        function(a, c, h, g) {
                            var y = c.docid || h("docid");
                            return g["docid_" + y] && g["docid_" + y].name && "isMingYi" in g["docid_" + y] ? {
                                    msg: g["docid_" + y]
                                }: a.info.get({
                                    _id: y
                                }).$promise
                        }],
                    loadJs: ["$ocLazyLoad",
                        function(a) {
                            return a.load({
                                name: "goToPrePayController",
                                files: ["//mcdn.anxinyisheng.com/Public/mobile/js/directive/payment_b914518.js"]
                            })
                        }]
                },
                templateUrl: "./partials/prepay.html"
            })
        }]),
    angular.module("myApp.controllers").controller("goToPrePayController", ["$window", "$timeout", "doctor", "data", "$state", "$scope", "ipCookie", "$stateParams", "$location", "Alert", "payAction", "Prompt", "$rootScope", "Couponlist", "couponBizType",
        function(a, c, h, g, y, v, w, $) {
            g = g.msg,
                v.icon = $.icon,
                v.docInfo = h.msg,
                v.price = Number($.price),
                v.auth = w("auth"),
                v.payInfo = {
                    auth: v.auth,
                    docid: v.docInfo._id,
                    initCoupon: $.couponEntityId || "",
                    chatFee: v.price
                },
                v.docIcon = v.docInfo.icon
        }]),
    angular.module("myApp").config(["$stateProvider", "$urlRouterProvider",
        function(a) {
            a.state("home.fillChatInfo", {
                url: "/fillChatInfo?auth&wx&docid&chatId",
                controller: "FillChatInfoCtrl",
                resolve: {
                    data: ["ipCookie", "$stateParams", "$http",
                        function(a, c) { !! c.auth && a("auth", c.auth),
                        !!c.docid && a("docid", c.docid)
                        }],
                    doctor: ["Doctor", "$stateParams", "ipCookie", "$localStorage",
                        function(a, c, h, g) {
                            var y = c.docid || h("docid");
                            return g["docid_" + y] && g["docid_" + y].name ? {
                                    msg: g["docid_" + y]
                                }: a.info.get({
                                    _id: y
                                }).$promise
                        }],
                    patients: ["PatientsList", "ipCookie",
                        function(a, c) {
                            return a.get({
                                docid: c("docid")
                            }).$promise
                        }],
                    supportDate: ["$ocLazyLoad",
                        function(a) {
                            var c = "testDate",
                                h = document.createElement("input");
                            h.setAttribute("type", "date"),
                                h.style.cssText = "position:absolute;visibility:hidden;",
                                h.value = c;
                            var g = !(h.value == c);
                            return g || (a.load("//mcdn.anxinyisheng.com/Public/mobile/bower/css/angular-datepicker_cebea3a.css"), a.load("//mcdn.anxinyisheng.com/Public/mobile/bower/js/angular-datepicker_95d8d4a.js")),
                                g
                        }],
                    SymptomsNew: ["doctor", "$stateParams", "SymptomsNew",
                        function(a, c, h) {
                            return h.get({
                                deptid: a.msg.dept._id
                            }).$promise
                        }]
                },
                templateUrl: "./partials/fillChatInfo.html"
            })
        }]),
    angular.module("myApp.controllers").controller("FillChatInfoCtrl", ["ChatInfoCache", "$scope", "$state", "ipCookie", "$stateParams", "patients", "Toast", "GetLastSymptoms", "SubChatInfo", "$location", "doctor", "supportDate", "SymptomsNew", "CreatePatient", "bLength", "$timeout", "$window", "makeHistory",
        function(a, c, h, g, y, v, w, $, b, I, C, S, L, P, T, A, k, D) {
            var _ = C.msg.dept._id,
                N = y.docid || g("docid"),
                O = g("auth");
            c.patients = v.msg.patients,
                c.chatId = y.chatId,
                c.docIcon = C.msg.icon;
            for (var E, i = 0; i < c.patients.length; i++) if (c.patients[i].islast) {
                E = c.patients[i]._id,
                    c.patients.unshift(c.patients[i]),
                    c.patients.splice(i + 1, 1);
                break
            }
            c.curLastSymptom,
                c.selectList = [],
                c.selectListName = [];
            var M = function() {
                if (c.curLastSymptom = "", c.curSymptom.length) for (var i = 0; i < c.curSymptom.length; i++) {
                    c.curLastSymptom += c.curSymptom[i].name + ",",
                        c.selectList.push(c.curSymptom[i]._id);
                    for (var u = 0; u < c.selectList.length; u++)("" == c.selectList[u] || "undefined" == typeof c.selectList[u]) && c.selectList.splice(u, 1);
                    for (var q = 0; q < c.selectList.length; q++)("" == c.selectListName[q] || "undefined" == typeof c.selectListName[q]) && c.selectListName.splice(q, 1);
                    for (var a = [], h = 0; h < c.curSymptom.length; h++) a.push(c.curSymptom[h]._id);
                    for (var g = 0; g < c.SymptomsNew.length; g++) {
                        var y = g;
                        c.SymptomsNew[g].selected = !1;
                        for (var l = 0; l < a.length; l++) c.SymptomsNew[y]._id == a[l] && (c.SymptomsNew[y].selected = !0)
                    }
                } else {
                    c.curLastSymptom = "",
                        c.selectList = [],
                        c.selectListName = [];
                    for (var m = 0; m < c.SymptomsNew.length; m++) c.SymptomsNew[m].selected = !1
                }
                c.curLastSymptom = c.curLastSymptom.slice(0, -1)
            };
            c.changePatient = function(a) {
                c.curPid = a,
                    c.selectList = [],
                    c.selectLists = [],
                    $.get({
                        pid: c.curPid,
                        deptid: _
                    }).$promise.then(function(a) {
                            if (200 == a.code) {
                                c.curSymptom = a.msg.illness_descs,
                                    M();
                                for (var i = 0; i < c.curSymptom.length; i++) c.selectLists.push(c.curSymptom[i]._id);
                                c.selectList = [].concat(c.selectLists),
                                    c.selectListName = [].concat(c.curLastSymptom.split(",")),
                                    c.selectL = angular.copy(c.selectList),
                                    c.selectLN = angular.copy(c.selectListName)
                            }
                        },
                        function() {
                            c.curSymptom = ""
                        }),
                    c.addpeople = !1
            },
                c.curPid = a.getCurPatient(c.chatId) || E || c.patients[0]._id,
                c.changePatient(c.curPid, _);
            var z = function() {
                c.isNeedPadding = c.addpeople || c.startStat || c.emptyPeople ? !0 : !1
            };
            c.$watch("addpeople",
                function() {
                    z(),
                        A(function() {
                            k.scrollTo(0, k.innerHeight)
                        })
                });
            var R = angular.element(document.querySelector("html"))[0].clientHeight;
            c.$watch(function() {
                A(function() {
                    c.isFocusInput = !!(angular.element(document.querySelector("html"))[0].clientHeight < R),
                        c.isFocusInput ? c.isNeedPadding = !1 : z()
                })
            }),
                c.startStat = !1,
                c.emptyPeople = !1,
                c.selectPe = !0,
                c.patients.length ? (c.emptyPeople = !1, c.selectPe = !0) : (c.emptyPeople = !0, c.selectPe = !1),
                c.addpeople = !1,
                c.openAddPeople = function() {
                    c.addpeople = !0,
                        c.curLastSymptom = "",
                        c.selectList = [],
                        c.selectListName = [],
                        c.curSymptom = [],
                        M(),
                        c.selectL = angular.copy(c.selectList),
                        c.selectLN = angular.copy(c.selectListName)
                },
                c.whichSex = function(a) {
                    c.sex = a
                },
                c.supportDate = S,
                c.cptInfo = {
                    birth: new Date("1980/1/1")
                },
                c.focus = function() {
                    c.isNameError = !1
                },
                c.clear = function() {
                    c.cptInfo.name = ""
                },
                c.dateChosen = !1,
                c.chooseDate = function() {
                    var a = angular.element(document.querySelector("#birth"))[0].value;
                    c.dateChosen = !!a
                },
                c.SymptomsNew = L.msg.list;
            var B = D({
                name: "/fillChatInfo",
                callback: function() {
                    A(function() {
                        c.selectBuff = !1
                    })
                }
            });
            c.selectBuff = !1,
                c.selectInless = function() {
                    c.selectBuff = !0,
                        B.make()
                },
                c.cloesBuff = function() {
                    c.selectBuff = !1;
                    for (var a = [], h = 0; h < c.selectList.length; h++) a.push(c.selectList[h]);
                    for (var g = 0; g < c.SymptomsNew.length; g++) {
                        var y = g;
                        c.SymptomsNew[g].selected = !1;
                        for (var l = 0; l < a.length; l++) c.SymptomsNew[y]._id == a[l] && (c.SymptomsNew[y].selected = !0)
                    }
                    c.selectL = angular.copy(c.selectList),
                        c.selectLN = angular.copy(c.selectListName),
                        B.back()
                },
                c.readyselect = function() {
                    c.selectBuff = !1,
                        c.selectList = angular.copy(c.selectL),
                        c.selectListName = angular.copy(c.selectLN);
                    var a = c.selectListName;
                    c.curLastSymptom = a.join(","),
                        B.back()
                };
            var F, U = !0;
            c.chooseChildren = function(a, h) {
                for (var m = 0; m <= c.selectL.length; m++) {
                    if (c.selectL[m] == a) return U = !1,
                        c.selectL.splice(m, 1),
                        c.selectLN.splice(m, 1),
                        c.SymptomsNew[h].selected = !1,
                        !1;
                    U = !0
                }
                if (F = U ? 5 : 6, !U) return ! 1;
                if (c.selectL.length >= F) return w.alert("最多只能选5个症状"),
                    !1;
                if (c.selectL.push(a), c.selectLN.push(c.SymptomsNew[h].illnessName), c.SymptomsNew[h].selected = !0, c.selectL) {
                    for (var p = 0; p < c.selectL.length; p++)("" == c.selectL[p] || "undefined" == typeof c.selectL[p]) && c.selectL.splice(p, 1);
                    for (var q = 0; q < c.selectL.length; q++)("" == c.selectLN[q] || "undefined" == typeof c.selectLN[q]) && c.selectLN.splice(q, 1)
                } else c.selectL = c.selectL,
                    c.selectLN = c.selectLN
            },
                c.ioBusy = !1,
                c.subChatInfo = function() {
                    if (c.ioBusy) return ! 1;
                    if (c.emptyPeople || c.addpeople) {
                        c.ioBusy = !0;
                        var h = [];
                        if (h = c.selectList, !c.cptInfo.name) return w.alert("请填写姓名"),
                            c.ioBusy = !1,
                            !1;
                        if (T(c.cptInfo.name) > 30) return c.isNameError = !0,
                            w.alert("姓名不能超过15个字"),
                            c.ioBusy = !1,
                            !1;
                        if (/[^\u4E00-\u9FA5^a-z^A-Z^0-9]/gi.test(c.cptInfo.name)) return c.isNameError = !0,
                            w.alert("姓名只能输入中文、英文和数字"),
                            c.ioBusy = !1,
                            !1;
                        if (!c.sex) return w.alert("请选择性别"),
                            c.ioBusy = !1,
                            !1;
                        var v = angular.element(document.querySelector("#birth"))[0].value;
                        if (!v || !c.dateChosen) return w.alert("请填写生日"),
                            c.ioBusy = !1,
                            !1;
                        var $ = {};
                        $.birth = new Date(v).getTime() / 1e3,
                            $.wx_id = g("wxid") || y.wx || y.wxId || y.wxid,
                            $.from = 3,
                            $.name = c.cptInfo.name,
                            $.sex = c.sex,
                            P.save($,
                                function(g) {
                                    if (200 == g.code) {
                                        c.ioBusy = !1;
                                        var v = g.msg.pid;
                                        w.alert("创建成功",
                                            function() {
                                                y.chatId && a.setCurPatient(y.chatId, g.msg.pid),
                                                    b.save({
                                                        pid: g.msg.pid,
                                                        chatid: c.chatId,
                                                        illness_descs: h.join(",")
                                                    }).$promise.then(function(a) {
                                                            return 200 !== a.code ? (w.alert(a.msg), c.ioBusy = !1, !1) : void I.path("/chat").search({
                                                                    auth: O,
                                                                    docid: N,
                                                                    pid: v
                                                                }).replace()
                                                        },
                                                        function(a) {
                                                            c.ioBusy = !1,
                                                                w.alert(a.data.msg)
                                                        })
                                            })
                                    } else w.alert(g.msg.desc),
                                        c.ioBusy = !1
                                },
                                function(a) {
                                    w.alert(a.data.msg.desc),
                                        c.ioBusy = !1
                                })
                    } else {
                        c.ioBusy = !0;
                        var h = [];
                        h = c.selectList,
                            console.log(h),
                            b.save({
                                pid: c.curPid,
                                chatid: c.chatId,
                                illness_descs: h.join(",")
                            }).$promise.then(function(h) {
                                    return 200 !== h.code ? (w.alert(h.msg), c.ioBusy = !1, !1) : (y.chatId && a.setCurPatient(y.chatId, c.curPid), void I.path("/chat").search({
                                            auth: O,
                                            docid: N,
                                            pid: c.curPid
                                        }).replace())
                                },
                                function(a) {
                                    c.ioBusy = !1,
                                        w.alert(a.data.msg)
                                })
                    }
                }
        }]),
    angular.module("myApp").config(["$stateProvider", "$urlRouterProvider",
        function(a) {
            a.state("home.recommend", {
                url: "/recommend?wx&shareTo&name&url_params&curCity&deptId",
                controller: "RecommendCtrl",
                level: 0,
                resolve: {
                    cityList: ["CityList", "$stateParams", "ipCookie", "$http",
                        function(a) {
                            return a.get().$promise
                        }],
                    loadGoShare: ["$ocLazyLoad",
                        function(a) {
                            return a.load({
                                name: "goShare",
                                files: ["//mcdn.anxinyisheng.com/Public/mobile/js/services/goShare_18316b9.js"]
                            })
                        }]
                },
                templateUrl: "./partials/recommend.html"
            })
        }]),
    angular.module("myApp.controllers").controller("RecommendCtrl", ["AD", "$timeout", "$state", "$scope", "ipCookie", "$location", "$stateParams", "Alert", "LastDoc", "$window", "Recommend", "cityList", "$localStorage", "bLength", "leftB", "RecommendLastCache", "goShare", "getHost", "$sessionStorage",
        function(a, c, h, g, y, v, w, $, b, I, C, S, L, P, T, A, k, D, _) {
            c(function() {
                wx.ready(function() {
                    wx.showOptionMenu(),
                        wx.hideMenuItems({
                            menuList: ["menuItem:share:qq", "menuItem:share:weiboApp", "menuItem:share:QZone", "menuItem:share:facebook", "menuItem:originPage", "menuItem:readMode", "menuItem:openWithQQBrowser", "menuItem:openWithSafari", "menuItem:share:email", "menuItem:editTag", "menuItem:delete", "menuItem:copyUrl"]
                        })
                })
            }),
                g.cityList = S.msg.cityList,
                g.curCity = g.cityList[0],
                g.deptId = "儿科";
            var N = null;
            w.url_params && (N = JSON.parse(w.url_params), _.followQr = {
                share_to: N.shareTo,
                name: "recommend"
            },
                g.curCity = N.curCity, g.deptId = N.deptId ? N.deptId: "儿科", sessionStorage.setItem("share_elizaqr", N.shareTo)),
                g.auth = w.auth || y("auth");
            var O, E = function() {
                    g.doctor = [],
                        g.resText = "努力加载中",
                        g.isLoadding = !0
                },
                M = function(a) {
                    g.resText = a,
                        g.isLoadding = !1
                },
                z = function(a) {
                    O && O.abort(),
                        U.css("display", "none"),
                        E(),
                        O = C.save(a),
                        O.$promise.then(function(a) {
                                if (200 == a.code) {
                                    g.curCity = a.msg.city,
                                        g.doctor = a.msg.docs;
                                    for (var i = 0; i < g.doctor.length; i++) {
                                        var c = g.doctor[i].skillField;
                                        c && P(c) > 69 && (g.doctor[i].skillField = T(c, 65) + "...")
                                    }
                                    A.set(g.curCity, g.deptId),
                                        M("暂无可选医生")
                                } else M(a.msg)
                            },
                            function() {
                                M("加载失败")
                            })
                };
            g.changeCity = function(a) {
                g.curCity = g.cityList[a],
                    z({
                        city: g.curCity,
                        deptName: g.deptId
                    }),
                    W(g.curCity, g.deptId)
            },
                g.changeDept = function(a) {
                    return g.isLocationBusy ? !1 : (g.deptId = a, z({
                            city: g.curCity,
                            deptName: g.deptId
                        }), void W(g.curCity, g.deptId))
                },
                g.showCtiy = !1;
            var R = angular.element(document.querySelector(".city")),
                B = angular.element(document.querySelector(".recommend"));
            g.toggleCityPanel = function() {
                return g.isLocationBusy ? !1 : (g.showCtiy = !g.showCtiy, void setTimeout(function() {
                            g.showCtiy ? (R.css("display", "block"), B.height(document.documentElement.clientHeight).css("overflow", "hidden")) : (R.css("display", "none"), B.height("auto").css("overflow", "auto"))
                        },
                        300))
            };
            var F = angular.element(document.querySelector(".header")).height(),
                U = angular.element(document.querySelector(".small-dept")),
                H = window.lib.flexible.rem2px(1.5);
            I.addEventListener("scroll",
                function() {
                    var a = angular.element(I).scrollTop(),
                        c = a > F - H ? "-webkit-box": "none";
                    U.css("display", c)
                },
                !1),
                E();
            var W = function(a, c) {
                    k({
                            curCity: a,
                            deptId: c,
                            name: "recommend"
                        },
                        {
                            title: "知名妇科、产科、儿科专家尽在「安心健康」",
                            desc: "女性|备孕|怀孕|育儿|成长健康问题，随时随地咨询大牌专家",
                            link: D.host + "/home/wx/toOtherDoctorShare",
                            imgUrl: ""
                        },
                        {
                            curCity: a,
                            deptId: c
                        },
                        "recommend")
                },
                G = A.get();
            G.city ? (g.deptId = G.dept, g.curCity = G.city, z({
                    city: G.city,
                    deptName: G.dept
                })) : z(N ? {
                        city: g.curCity,
                        deptName: g.deptId
                    }: {
                        deptName: g.deptId
                    }),
                a.get({
                    position: 1
                }).$promise.then(function(a) {
                    var h = a.msg.list;
                    g.adList = h;
                    var y = 1,
                        v = g.adList.length,
                        w = 3e3;
                    g.adWidth = document.documentElement.getBoundingClientRect().width,
                    v > 1 && c(function $() {
                            y >= v && (y = 0);
                            var a = -100 / v * y;
                            g.adtrans = "translateX(" + a + "%)",
                                y += 1,
                                c($, w)
                        },
                        w),
                        g.hasAdPanelStyle = g.adList.length ? "3.22rem": "1.375rem"
                }),
                W(g.curCity, g.deptId)
        }]),
    angular.module("myApp").config(["$stateProvider", "$urlRouterProvider",
        function(a) {
            a.state("home.elizaAppt", {
                url: "/elizaAppt?docid&auth&wx&from&to&prefrom&couponEntityId&hospitalId",
                controller: "elizaAppt",
                level: 30,
                resolve: {
                    doctor: ["GetEliza", "$stateParams", "ipCookie", "$localStorage",
                        function(a, c, h) {
                            var g = c.docid || h("docid");
                            return a.get({
                                docId: g
                            }).$promise
                        }],
                    apptList: ["ElizaApptList", "$stateParams", "ipCookie",
                        function(a, c, h) {
                            var g = c.docid || h("docid"),
                                y = {
                                    docid: g
                                };
                            return y.from = c.from,
                                y.to = c.to,
                                y.prefrom = c.prefrom,
                                a.post(y).$promise
                        }]
                },
                templateUrl: "./partials/elizaAppt.html"
            })
        }]),
    angular.module("myApp.controllers").controller("elizaAppt", ["Toast", "DateWithWeek", "$scope", "$state", "$localStorage", "$location", "$stateParams", "ipCookie", "doctor", "Alert", "$window", "apptList", "CacheInfo", "$timeout",
        function(a, c, h, g, y, v, w, $, b, I, C, S, L, P) {
            function T() {
                function y() {
                    for (var a = window.CONFIG ? window.CONFIG.serverTime: (new Date).getTime() / 1e3, n = 0; n < h.apptList.length; n++) for (var c = 0; c < h.apptList[n].times.length; c++) {
                        h.aheadOrderTime = h.showclinic.aheadOrderTime,
                            console.log(h.showclinic.aheadOrderTime);
                        var g = Number(a) + Number(3600 * h.aheadOrderTime);
                        h.apptList[n].times[c].st < g && (h.apptList[n].times[c].amount = 0)
                    }
                }
                h.cur = null,
                    h.curTime = null,
                    h.picList = h.showclinic.picList,
                    h.picLength = h.picList.length,
                    h.picwidth = {
                        width: 88 * h.picList.length / 37.5 + "rem"
                    };
                var v, $ = 9;
                h.hosiInfoCorn = {},
                    h.apptList = h.showclinic.appointList,
                    h.textalign = !0,
                    h.textalign = h.apptList.length > 1 ? !1 : !0,
                    console.log(h.hosiInfo),
                h.apptList.length && h.hosiInfo.isOn && 1 == h.hosiInfo.isOn && (h.hosiInfoCorn.address = h.hosiInfo.address, v = h.hosiInfo.addressDetail, h.picList = h.showclinic.picList, h.picLength = h.picList.length, h.ifFree = h.hosiInfo.appointFee ? !0 : !1, y()),
                    h.hasSchedules = h.apptList.length ? !0 : !1,
                    y(),
                    h.chatTime = 15;
                var b = [];
                h.noAmount = !1,
                    console.log("ssas", h.apptList);
                for (var I = 0; I < h.apptList.length; I++) {
                    b.push({
                        hasData: 0
                    });
                    for (var T = h.apptList[I].times, D = T.length, _ = 0; D > _; _++) ! b[I].hasData && T[_].amount > 0 && (b[I] = {
                        hasData: 1,
                        dateId: I,
                        timeId: _
                    }),
                        h.apptList[I].times[_].dateId = I;
                    h.apptList[I].timesGroup = [];
                    for (var m = 0; D > m; m += $) h.apptList[I].timesGroup.push(T.slice(m, m + $));
                    h.apptList[I].dateId = I,
                        h.apptList[I].dateable = h.apptList[I].date.slice(5).replace("-", "月") + "日"
                }
                console.log(b);
                for (var N = [], O = [], m = 0; m < b.length; m++) b[m].hasData <= 0 ? N.push(m) : O.push(m);
                N.length >= b.length && (h.noAmount = !0);
                for (var i = 0; i < b.length; i++) if (b[i].hasData) {
                    var E = b[i];
                    h.cur = h.apptList[E.dateId],
                        h.curTime = h.cur.times[E.timeId],
                        h.timesShow = h.cur.timesGroup[parseInt(E.timeId / $)],
                        h.hasSchedules = !0;
                    break
                }
                if (!h.cur) for (var i = 0; i < h.apptList.length; i++) {
                    h.cur = h.apptList[i],
                        h.timesShow = h.cur.timesGroup[0],
                        h.hasSchedules = !0;
                    break
                }
                h.noTime = !1,
                    h.man = !0,
                    h.serviceInfo = S.msg.serviceInfo,
                    h.serveCount = h.serviceInfo.serveCount,
                    h.satisfied = h.serviceInfo.satisfied,
                h.serveCount < 10 && (h.man = !1);
                var M = angular.element(C)[0].innerWidth;
                h._width = M,
                    h.chooseDay = function(a) {
                        if (console.log(b[a]), h.cur.dateId == a) return ! 1;
                        h.ableindex = a,
                        h.apptList[a].length >= 4 && (a > 0 && a < h.apptList[a].length - 1 ? angular.element(document.querySelector(".horiza")).css({
                                "margin-left": -M / 3 * (a - 1) + "px"
                            }) : a == h.apptList[a].length - 1 && angular.element(document.querySelector(".horiza")).css({
                                "margin-left": -M / 3 * (a - 2) + "px"
                            }));
                        var c = b[a];
                        h.curTime = h.apptList[a].times[c.timeId],
                            console.log("curTime", h.curTime),
                        h.curTime && (h.queenHospitalId = h.curTime.queenHospitalId),
                            h.cur = h.apptList[a];
                        for (var x = 0; x < N.length; x++) if (N[x] == a) return void(h.noTime = !0);
                        h.noTime = !1
                    };
                var z;
                h.chooseTime = function(a, c) {
                    if (a.amount <= 0) return ! 1;
                    h.cur = h.apptList[a.dateId];
                    var g = (h.curSlideIndex - 1) * $ + c;
                    h.curTime = h.apptList[a.dateId].times[g],
                        h.queenHospitalId = h.curTime.queenHospitalId
                },
                    h.$watch("cur",
                        function() {
                            if (h.cur) {
                                var a = b[h.cur.dateId].timeId,
                                    c = a ? parseInt(a / $) : 0;
                                h.timesShow = h.cur.timesGroup[c];
                                var g = h.cur.times.length;
                                h.showLeftHandle = c > 0,
                                    h.curIndexAll = Math.ceil(g / $),
                                    h.curSlideIndex = c + 1,
                                    h.showRightHandle = !(!(g > $) || h.curSlideIndex == h.curIndexAll)
                            }
                        }),
                    h.$watch("curTime",
                        function() {
                            h.canSubmit = !!h.curTime,
                            h.curTime && (h.chatTime = (h.curTime.et - h.curTime.st) / 60 || 15),
                            h.curTime && (h.curTimeForShow = c(h.cur.date) + " " + B(h.curTime.st)),
                                z = h.curTime ? h.curTime.scheduleId: ""
                        }),
                    h.slide = function(a) {
                        "left" === a ? h.curSlideIndex -= 1 : h.curSlideIndex += 1,
                            h.timesShow = h.cur.timesGroup[h.curSlideIndex - 1],
                            h.showLeftHandle = !(1 == h.curSlideIndex),
                            h.showRightHandle = !(h.curSlideIndex == h.curIndexAll)
                    };
                var R = function(a) {
                        return parseInt(a, 10) >= 10 ? "" + a: "0" + a
                    },
                    B = function(a) {
                        var c = new Date(1e3 * parseInt(a));
                        return R(c.getHours()) + ":" + R(c.getMinutes())
                    };
                h.confirm = function() {
                    return z ? (L.set("address", h.realladdress), L.set("curTimeShow", h.curTimeForShow), void g.go("home.elizaApptSub", {
                            schId: z,
                            docid: h.doctor.docId,
                            couponEntityId: w.couponEntityId
                        })) : (a.alert("请选择预约时间"), !1)
                },
                    h.isEliza = h.price < h.origPrice;
                var F = function() {
                        h.whichShow = {
                            policy: !1,
                            addr: !1
                        }
                    },
                    U = function() {
                        h.btnAll = {
                            policy: !1,
                            addr: !1
                        }
                    },
                    H = function() {
                        h.btnAll = {
                            policy: !0,
                            addr: !0
                        }
                    };
                H(),
                    h.isShowPolicy = !1,
                    h.showPolicy = function(a) {
                        h.isShowPolicy = !h.isShowPolicy,
                            h.isShowPolicy ? k() : A(),
                            h.isShowPolicy ? (F(), U(), h.whichShow[a] = !0, h.btnAll[a] = !0) : (H(), h.whichShow[a] = !1)
                    },
                    h.closePolicy = function() {
                        h.isShowPolicy = !1,
                            A(),
                            F(),
                            H()
                    },
                    h.ifshowtxt = !1;
                var W = {
                    one: "",
                    two: "",
                    three: ""
                };
                h.ifshowtxt = {},
                    h.ifbutton = {},
                    P(function() {
                            W.one = angular.element(document.querySelector("#corn1")),
                                W.two = angular.element(document.querySelector("#only4")),
                                W.three = angular.element(document.querySelector("#only3")),
                                W.one.height() > 1 * C.lib.flexible.rem2px(.5867) ? (h.ifshowtxt.one = !0, h.ifbutton.one = !0) : (h.ifshowtxt.one = !1, h.ifbutton.one = !1),
                                W.two.height() > 2 * C.lib.flexible.rem2px(.5867) ? (h.ifshowtxt.two = !0, h.ifbutton.two = !0) : (h.ifshowtxt.two = !1, h.ifbutton.two = !1),
                                W.three.height() > 1 * C.lib.flexible.rem2px(.5867) ? (h.ifshowtxt.three = !0, h.ifbutton.three = !0) : (h.ifshowtxt.three = !1, h.ifbutton.three = !1)
                        },
                        20),
                    h.ifupdown = {
                        skill: !1,
                        achieve: !1,
                        address: !1
                    },
                    h.showupdown = function(a) {
                        switch (a) {
                            case "skill":
                                h.ifupdown.skill = !h.ifupdown.skill,
                                    h.ifshowtxt.two = !h.ifshowtxt.two;
                                break;
                            case "achieve":
                                h.ifupdown.achieve = !h.ifupdown.achieve,
                                    h.ifshowtxt.one = !h.ifshowtxt.one;
                                break;
                            case "address":
                                h.ifupdown.address = !h.ifupdown.address,
                                    h.ifshowtxt.three = !h.ifshowtxt.three
                        }
                    },
                    h.apptTab = ["选择就诊时间", "查看预约说明"],
                    h.timeTabindex = 0,
                    h.myBottom = !1,
                    h.changetimeTab = function(a) {
                        h.timeTabindex = a,
                            h.myBottom = 1 == a ? !0 : !1
                    },
                    h.achieve = !1,
                    h.showachieve = function() {
                        h.achieve = !0
                    },
                    h.closeachieve = function() {
                        h.achieve = !1
                    },
                    h.showP = !1,
                    h.showpicture = function() {
                        h.showP = !h.showP
                    },
                    h.showBig = !1,
                    h.picindex = 0,
                    h.ShowPictureB = function(a) {
                        h.showBig = !h.showBig,
                            h.showP = !0,
                            h.picindex = a,
                            console.log(h.picList),
                            console.log(h.picindex)
                    },
                    document.getElementById("bigIMG"),
                    h.slide1 = function(a) {
                        "Right" == a.direction ? h.picindex = h.picindex - 1 : "Left" == a.direction && (h.picindex = h.picindex + 1),
                            h.picindex >= h.picList.length ? h.picindex = 0 : h.picindex < 0 && (h.picindex = h.picList.length - 1),
                            console.log(h.picindex)
                    }
            }
            var A = function() {
                    angular.element(document.querySelector("body")).css("overflow", "auto")
                },
                k = function() {
                    angular.element(document.querySelector("body")).css("overflow", "hidden")
                };
            if (h.doctor = b.msg, h.myLabels = h.doctor.labels && h.doctor.labels.length ? h.doctor.labels.slice(0, 4) : [], 200 !== S.code) return I.alert(S.msg,
                function() {
                    C.history.back()
                }),
                !1;
            h.paiban = S.msg.hospitalInfo;
            for (var D = w.hospitalId,
                     i = 0; i < h.paiban.length; i++) h.paiban[i].queenHospitalId == D ? (h.showclinic = h.paiban[i], h.hosiInfo = S.msg.hospitalInfo[i], h.realladdress = h.paiban[i].addressDetail, h.upcheck = i) : (h.showclinic = h.paiban[0], h.hosiInfo = S.msg.hospitalInfo[0], h.realladdress = h.paiban[0].addressDetail, h.upcheck = 0);
            h.upClinic = !1,
                h.updateClinic = function() {
                    h.upClinic = !0
                },
                h.selectClinic = function(a) {
                    h.upClinic = !1,
                        h.showclinic = h.paiban[a],
                        h.apptList = h.showclinic.appointList,
                        h.hosiInfo = S.msg.hospitalInfo[a],
                        h.realladdress = h.paiban[a].addressDetail,
                        h.upcheck = a,
                        h.hasSchedules = h.apptList.length ? !0 : !1,
                        console.log(h.apptList),
                        T()
                },
                h.hideSelect = function() {
                    h.upClinic = !1
                },
                T()
        }]),
    angular.module("myApp").config(["$stateProvider", "$urlRouterProvider",
        function(a) {
            a.state("home.elizaApptSub", {
                url: "/elizaApptSub?docid&auth&wx&schId&couponEntityId",
                controller: "elizaApptSub",
                level: 30,
                resolve: {
                    apptPrice: ["ipCookie", "$stateParams", "CacheInfo", "ElizaApptPrice",
                        function(a, c, h, g) {
                            var y = c.docid || a("docid");
                            return g.post({
                                docid: y,
                                scheduleId: c.schId
                            }).$promise
                        }],
                    Patient: ["Patient",
                        function(a) {
                            return a.get().$promise
                        }],
                    loadJs: ["$ocLazyLoad",
                        function(a) {
                            return a.load({
                                name: "elizaApptSubCtrl",
                                files: ["//mcdn.anxinyisheng.com/Public/mobile/js/directive/couponPanel_6fa47f7.js"]
                            })
                        }],
                    patients: ["PatientsList",
                        function(a) {
                            return a.get().$promise
                        }],
                    doctor: ["GetEliza", "$stateParams", "ipCookie", "$localStorage",
                        function(a, c, h) {
                            var g = c.docid || h("docid");
                            return a.get({
                                docId: g
                            }).$promise
                        }]
                },
                templateUrl: "./partials/elizaApptSub.html"
            })
        }]),
    angular.module("myApp.controllers").controller("elizaApptSub", ["Toast", "DateWithWeek", "$scope", "$state", "$localStorage", "$location", "$stateParams", "ipCookie", "Alert", "$window", "apptPrice", "ElizaCheckAppt", "CacheInfo", "Patient", "payAction", "ELizaUpdateApptMobile", "makeHistory", "$timeout", "Couponlist", "couponBizType", "patients", "doctor",
        function(a, c, h, g, y, v, w, $, b, I, C, S, L, P, T, A, k, D, _, N, O, E) {
            h.mobile = P.msg.mobile,
                console.log(O.msg.patients),
                h.patients = O.msg.patients,
                h.curTimeForShow = L.get("curTimeShow"),
                h.myAddress = L.get("address"),
                console.log(h.myAddress),
                h.elizaOrignPrice = C.msg.price,
                h.elizaDeposit = C.msg.deposit,
                h.elizaAppointFee = C.msg.appointFee,
                h.medicalInfo = C.msg.medicalInfo,
                h.Discount = h.elizaOrignPrice - h.elizaAppointFee;
            var M = /.*\..*/;
            h.Discount = M.test(h.Discount) ? h.Discount.toFixed(2) : h.Discount,
                h.addressMap = C.msg.addressMap;
            var z = function() {
                    angular.element(document.querySelector("body")).css("overflow", "auto")
                },
                R = function() {
                    angular.element(document.querySelector("body")).css("overflow", "hidden")
                },
                B = w.docid || $("docid") || "",
                F = w.auth || $("auth") || "";
            h.couponlist = [],
                h.initCoupon = w.couponEntityId,
                h.choosenCoupon = {},
                h.originPrice = h.elizaAppointFee,
            0 == h.originPrice && (h.initCoupon = "notuse"),
                h.chooseCallback = function(a) {
                    h.choosenCoupon = a
                },
                _.get({
                    type: 0,
                    biztype: N.eliza,
                    docId: B,
                    docid: B
                }).$promise.then(function(a) {
                    200 === a.code && (h.couponlist = a.msg.validCoupons)
                }),
                h.showCounpanPanel = function() {
                    h.$broadcast("showCounpanPanel")
                },
                h.ADD = !1,
                h.addpeople = function() {
                    h.ADD = !0
                },
                h.closeADD = function() {
                    h.ADD = !1
                },
                h.userName = h.patients[0].name,
                h.selectPeople = function(a) {
                    h.ADD = !1,
                        h.userName = h.patients[a].name
                };
            var U = document.getElementById("userName"),
                H = document.getElementById("mobile");
            h.Addpeoples = function() {
                h.userName = "",
                    U.focus(),
                    h.ADD = !1
            },
                h.addtel = function() {
                    h.mobile = "",
                        H.focus()
                },
                h.onblurT = function() {
                    "" == h.userName && (h.userName = h.patients[0].name),
                        console.log(h.patients[0])
                },
                h.onblurM = function() {
                    "" == h.mobile && (h.mobile = P.msg.mobile),
                        console.log(h.userName)
                },
                h.isIoBusy = !1;
            var W = function() {
                    if (h.isIoBusy) return ! 1;
                    h.isIoBusy = !0;
                    var a = h.userName;
                    console.log(a);
                    var c = w.schId;
                    S.post({
                        scheduleId: c,
                        docid: B,
                        userMobile: h.mobile,
                        userName: h.userName
                    }).$promise.then(function(a) {
                        if (200 === a.code) h.appointId = a.msg.appointId,
                            h.mobile !== P.msg.mobile ? A.post({
                                    userMobile: h.mobile,
                                    queenAppointId: h.appointId
                                }).$promise.then(function(a) {
                                    200 === a.code ? G() : b.alert("手机号更新失败，请重试")
                                }) : G();
                        else {
                            var c = a.msg.desc || a.msg;
                            b.alert(c),
                                h.isIoBusy = !1
                        }
                    })
                },
                G = function() {
                    var a = {
                        docid: B,
                        money: h.elizaDeposit || 0,
                        auth: F,
                        appointId: h.appointId,
                        couponEntityId: ""
                    };
                    h.couponlist.length && h.choosenCoupon.couponEntityId && (a.couponEntityId = h.choosenCoupon.couponEntityId),
                        T(h, g, a, {
                            type: 9,
                            suc: function() {
                                v.path("/feedbackSuc").search({
                                    msg: "您已预约成功",
                                    msg_small: "请您注意查收预约确认短信",
                                    icon: "suc"
                                }).replace()
                            },
                            fail: function() {
                                h.isIoBusy = !1
                            }
                        })
                };
            h.pay = function() {
                return h.secondrealy = !1,
                    h.mobile ? /^1\d{10}$/gi.test(h.mobile) ? void W() : (a.alert("请正确填写手机号码"), !1) : (a.alert("联系方式不能为空"), !1)
            },
                h.ifshowtxt = !1;
            var Q = {
                one: ""
            };
            h.ifshowtxt = {},
                h.ifbutton = {},
                D(function() {
                        Q.one = angular.element(document.querySelector("#corn4")),
                            Q.one.height() > 1 * I.lib.flexible.rem2px(.5867) ? (h.ifshowtxt.one = !0, h.ifbutton.one = !0) : (h.ifshowtxt.one = !1, h.ifbutton.one = !1)
                    },
                    20),
                h.ifupdown = {
                    zhi: !1
                },
                h.showupdown = function() {
                    h.ifupdown.zhi = !h.ifupdown.zhi,
                        h.ifshowtxt.one = !h.ifshowtxt.one
                };
            var V = function() {
                    h.whichShow = {
                        address: !1,
                        know: !1
                    }
                },
                j = function() {
                    h.btnAll = {
                        address: !1,
                        know: !1
                    }
                },
                Y = function() {
                    h.btnAll = {
                        address: !0,
                        know: !0
                    }
                };
            Y(),
                h.showPolicy = function(a) {
                    h.isShowPolicy = !h.isShowPolicy,
                        h.isShowPolicy ? R() : z(),
                        h.isShowPolicy ? (V(), j(), h.whichShow[a] = !0, h.btnAll[a] = !0) : (Y(), h.whichShow[a] = !1)
                },
                h.closePolicy = function() {
                    h.isShowPolicy = !1,
                        z(),
                        V(),
                        Y()
                },
                h.Jadd = !1,
                h.showJadd = function() {
                    h.Jadd = !h.Jadd
                },
                h.secondrealy = !1,
                h.realypay = function() {
                    h.secondrealy = !0
                },
                h.doctor = E.msg,
                h.closeSend = function() {
                    h.secondrealy = !1
                },
                h.secondpay = function() {
                    h.secondrealy = !1
                },
                console.log(angular.element(document.querySelector("#realprice")));
            var J = angular.element(I).height();
            console.log(J),
                h.isposiation = !0,
                h.$watch(function() {
                    D(function() {
                        h.isposiation = angular.element(I).height() < J ? !1 : !0
                    })
                })
        }]),
    angular.module("myApp").config(["$stateProvider", "$urlRouterProvider",
        function(a) {
            a.state("home.center", {
                url: "/center?auth&wx&docid",
                controller: "center",
                level: 10,
                resolve: {},
                templateUrl: "./partials/center.html"
            })
        }]),
    angular.module("myApp.controllers").controller("center", ["$scope", "$stateParams", "ipCookie", "CenterInfo", "ParseDate", "ParseDate",
        function(a, c, h, g, y) {
            a.wx = c.wxid || c.wx || h("wxid"),
                a.auth = c.auth || h("auth"),
                a.vip_page = !1,
                g.get({}).$promise.then(function(c) {
                    if (200 == c.code) {
                        a.centerinfo = c.msg;
                        var h = y(1e3 * c.msg.expiredTime).slice(0, 10).split("-");
                        a.expiredTime = h[0] + "年" + h[1] + "月" + h[2] + "日"
                    }
                })
        }]),
    angular.module("myApp").config(["$stateProvider", "$urlRouterProvider",
        function(a) {
            a.state("home.myvip", {
                url: "/myvip?auth&wx&from&bizid&link&qrInfo",
                controller: "myvip",
                level: 10,
                resolve: {},
                templateUrl: "./partials/myvip.html"
            })
        }]),
    angular.module("myApp.controllers").controller("myvip", ["$scope", "Prompt", "CenterInfo", "VipGoods", "payAction", "$state", "Toast", "$timeout", "$stateParams", "ParseDate", "$location", "ipCookie",
        function(a, c, h, g, y, v, w, $, b, I, C, S) {
            h.get({}).$promise.then(function(c) {
                if (200 == c.code) {
                    a.centerinfo = c.msg;
                    var h = I(1e3 * c.msg.expiredTime).slice(0, 10).split("-");
                    a.expiredTime = h[0] + "年" + h[1] + "月" + h[2] + "日"
                }
            }),
                g.get({
                    from: b.from || ""
                }).$promise.then(function(c) {
                    200 == c.code && (a.goodslist = c.msg)
                }),
                a.paybusy = !1;
            var L = b.wx || S("wxid"),
                P = b.auth || S("auth");
            a.beVip = function(c) {
                if (a.paybusy) return ! 1;
                a.paybusy = !0;
                var h = {
                    from: b.from,
                    vipGoodsId: c,
                    vipPurchaseId: "",
                    couponEntityId: ""
                };
                y(a, v, h, {
                    type: 8,
                    suc: function() {
                        var c = "";
                        c = 0 == a.centerinfo.vipStatus ? "开通成功": "续费成功",
                            w.alert(c,
                                function() {
                                    switch (b.from) {
                                        case "FROM_YD":
                                            location.href = "http://" + location.host + "/home/wx/toYdDetail?questionId=" + b.bizid;
                                            break;
                                        case "FROM_LESSON":
                                            console.log(b.link),
                                                location.href = b.link;
                                            break;
                                        default:
                                            C.path("/myvip").search({
                                                wx:
                                                L,
                                                auth: P
                                            }).replace()
                                    }
                                }),
                            a.paybusy = !1
                    },
                    fail: function() {
                        a.paybusy = !1
                    }
                })
            },
                a.vip_page = !0;
            var T, A, k;
            $(function() {
                    T = angular.element(document.querySelector(".myimglec")),
                        A = angular.element(document.querySelector(".myimgqa")),
                        k = angular.element(document.querySelector(".myimgyhq"))
                },
                20),
                a.openqa = function() {
                    c.alert(A[0].src, "一答问题免费看", ["有效期内查看“妇儿·必看”中的一答问题，不限次数，想看就看！"], "知道了")
                },
                a.openlec = function() {
                    c.alert(T[0].src, "安心讲堂免费参加", ["有效期内畅听安心讲堂付费课程，名医授课，一次不落"], "知道了")
                },
                a.openyhq = function() {
                    c.alert(k[0].src, "免费预约安心名医", ["1、购买6个月VIP会员，将获赠1张最高价值480元的【预约安心名医免费体验券】", "2、仅限咨询过北京、广州地区医生的用户", "3、购买6个月会员专享", "4、已有免费体验券的用户不再重复发送"], "知道了",
                        function() {},
                        !0)
                };
            var D = window.CONFIG ? 1e3 * parseInt(window.CONFIG.serverTime) : (new Date).getTime();
            a.isBannerShow = 14832e8 >= D
        }]),
    angular.module("myApp").config(["$stateProvider", "$urlRouterProvider",
        function(a) {
            a.state("home.msgCenter", {
                url: "/msgCenter?wx&auth",
                level: 10,
                templateUrl: "./partials/msgCenter.html",
                controller: ["$scope", "ParseDate", "$stateParams", "ipCookie", "msgUserLists", "msgUserHasRead",
                    function(a, c, h, g, y, v) {
                        g("wxid", h.wx),
                        h.auth && g("auth", h.auth);
                        var w, $ = 15,
                            b = function() {
                                w = 1,
                                    a.isShowLoading = !0,
                                    a.isData = !1,
                                    a.isShowMoreLoading = !1
                            };
                        b(),
                            y.save({
                                pageSize: $,
                                pageIndex: w
                            }).$promise.then(function(c) {
                                if (200 == c.code) {
                                    if (a.isShowLoading = !1, a.msgs = c.msg.lists, !a.msgs.length) return void(a.isData = !0);
                                    for (var i = 0; i < a.msgs.length; i++) {
                                        var h = new Date(1e3 * a.msgs[i].createTime);
                                        a.msgs[i].createTime = h.getFullYear() + "年" + (Number(h.getMonth()) + 1) + "月" + h.getDate() + "日 " + h.getHours() + ":" + h.getMinutes()
                                    }
                                }
                            });
                        var I = !1,
                            C = !1;
                        a.loadMore = function() {
                            return I || C ? !1 : (I = !0, a.isShowMoreLoading = !0, void y.save({
                                    pageSize: $,
                                    pageIndex: ++w
                                }).$promise.then(function(c) {
                                    if (200 == c.code) {
                                        I = !1,
                                            a.isShowMoreLoading = !1;
                                        var h = c.msg.lists;
                                        if (!a.msgs.length) return a.isData = !0,
                                            void(C = !0);
                                        a.msgs.length < $ && (C = !0);
                                        for (var i = 0; i < h.length; i++) {
                                            var g = new Date(1e3 * h[i].createTime);
                                            h[i].createTime = g.getFullYear() + "年" + (Number(g.getMonth()) + 1) + "月" + g.getDate() + "日 " + g.getHours() + ":" + g.getMinutes(),
                                                a.msgs.push(h[i])
                                        }
                                    }
                                }))
                        },
                            a.goMsgChat = function(a, c) {
                                v.save({
                                    messageId: c
                                }).$promise.then(function(c) {
                                    200 == c.code && (location.href = a)
                                })
                            }
                    }]
            })
        }]),
    angular.module("myApp.controllers").controller("DocTopBarCtrl", ["ipCookie", "$location", "$scope", "$stateParams",
        function(a, c, h, g) {
            h.auth = g.auth || a("auth"),
                h.docid = g.docid || a("docid"),
                h.curPath = c.path(),
                h.isInChat = "/chat" == h.curPath || "/goto_prepay" == h.curPath || "/fillChatInfo" == h.curPath,
                h.isChatTopBarHide = !1,
            "/history" === h.curPath && (h.isChatTopBarHide = !!c.$$search.isHideNav)
        }]),
    angular.module("myApp").config(["$stateProvider", "$urlRouterProvider",
        function(a) {
            a.state("home.goChat", {
                url: "/goChat?docId&auth&couponEntityId&qrInfo&from",
                templateUrl: "./partials/w/isLoading.html",
                controller: ["$state", "PayWayCheck", "Chat", "ipCookie", "$stateParams", "$location", "Alert", "CacheInfo", "goChatRecord",
                    function(a, c, h, g, y, v, w, $, b) {
                        var I = y.docId,
                            C = y.auth;
                        I && g("docid", I);
                        var S = function() {
                            v.path("/doctor").search({
                                id: I,
                                auth: C
                            }).replace()
                        };
                        y.from && b.save({
                            from: y.from,
                            docId: I
                        }).$promise.then(function() {}),
                            c.get({
                                docid: I
                            }).$promise.then(function(a) {
                                200 === a.code ? h.exist.get({
                                            docid: I
                                        },
                                        function(c) {
                                            if (401 === check.code) return ! 1;
                                            if (200 !== c.code) return w.alert(c.msg, S),
                                                !1;
                                            if ("1" == c.msg.status) return void v.path("/chat").search({
                                                docid: I,
                                                auth: C,
                                                pid: c.msg.pid
                                            }).replace();
                                            if ("2" == c.msg.status) return void v.path("/fillChatInfo").search({
                                                docid: I,
                                                auth: C,
                                                chatId: c.msg.chatId
                                            }).replace();
                                            if (2 == a.msg.needPay || 3 == a.msg.needPay) {
                                                var h = {
                                                    price: a.msg.money,
                                                    docid: I
                                                };
                                                y.couponEntityId && (h.couponEntityId = y.couponEntityId),
                                                    v.path("/goto_prepay").search(h).replace()
                                            } else w.alert("收费参数错误", S)
                                        }) : 401 !== a.code && w.alert(a.msg, S)
                            })
                    }]
            })
        }]),
    angular.module("myApp.services").factory("Reg", ["$resource",
        function(a) {
            return a("/home/user/register", {},
                {
                    update: {
                        method: "POST"
                    }
                })
        }]).factory("CodeVerify", ["$resource",
        function(a) {
            return a("/home/user/registerVerify")
        }]).factory("telReg", ["$resource",
        function(a) {
            return a("/home/user/registerAccount")
        }]).factory("Complete", ["$resource",
        function(a) {
            return a("/home/user/complete")
        }]).factory("Doctor", ["$resource",
        function(a) {
            var c = a("/home/user/doc_list");
            return c.info = a("/home/user/doc_detail"),
                c.lightSchedule = a("/home/appoint/getLightScheduleByH5"),
                c
        }]).factory("CouponState", ["$resource",
        function(a) {
            return a("/home/coupon/getCouponStateByDocidNew")
        }]).factory("LastDoc", ["$resource",
        function(a) {
            return a("/home/user/doc_last")
        }]).factory("DoctorCount", ["$resource",
        function(a) {
            return a("/home/user/getDoctorCount")
        }]).factory("ifRegisted", ["$resource",
        function(a) {
            return a("/home/user/isRegisterByWxId")
        }]).factory("UserLevel", ["$resource",
        function(a) {
            return a("/home/user/getUserLevel")
        }]).factory("Patient", ["$resource",
        function(a) {
            return a("/home/user/me")
        }]).factory("Chat", ["$resource",
        function(a) {
            var c = a("/home/chat/select", {},
                {
                    query: {
                        method: "GET",
                        timeout: 3e3
                    }
                });
            return c.send = a("/home/chat/send_user", {},
                {
                    post: {
                        method: "POST"
                    }
                }),
                c.star = a("/home/chat/rank", {},
                    {
                        post: {
                            method: "POST"
                        }
                    }),
                c.limit = a("/home/inquiry/select", {},
                    {
                        get: {
                            method: "POST"
                        }
                    }),
                c.exist = a("/home/chat/chat_current"),
                c.history = a("/home/chat/history"),
                c.start = a("/home/chat/start_chat"),
                c
        }]).factory("Audio", ["$resource",
        function(a) {
            return a("/home/api/upload", {},
                {
                    post: {
                        method: "POST"
                    }
                })
        }]).factory("UploadWx", ["$resource",
        function(a) {
            return a("/home/api/uploadWx", {},
                {
                    post: {
                        method: "POST"
                    }
                })
        }]).factory("Response", ["$resource",
        function(a) {
            return a("/home/msg/show")
        }]).factory("OrderList", ["$resource",
        function(a) {
            return a("/home/order/lists", {},
                {
                    query: {
                        method: "GET",
                        cache: !0
                    }
                })
        }]).factory("OrderDetail", ["$resource",
        function(a) {
            return a("/home/order/detail")
        }]).factory("OrderDetailVip", ["$resource",
        function(a) {
            return a("/home/appoint/detailVipH5")
        }]).factory("OrderDetailVipConfirm", ["$resource",
        function(a) {
            return a("/home/appoint/confirmVipAppoint")
        }]).factory("OrderDetailVipCancel", ["$resource",
        function(a) {
            return a("/home/appoint/cancelVipAppoint")
        }]).factory("OrderDetailCall", ["$resource",
        function(a) {
            return a("/home/call/detailH5")
        }]).factory("UnsatisfiedOption", ["$resource",
        function(a) {
            return a("/home/chat/comment")
        }]).factory("UnsatisfiedSub", ["$resource",
        function(a) {
            return a("/home/chat/advice")
        }]).factory("SatisfiedInfo", ["$resource",
        function(a) {
            return a("/home/chat/comment")
        }]).factory("DoOrder", ["$resource",
        function(a) {
            return a("/home/pay/order", {},
                {
                    post: {
                        method: "POST"
                    }
                })
        }]).factory("DoOrderContinue", ["$resource",
        function(a) {
            return a("/home/pay/order_continue")
        }]).factory("CheckOrder", ["$resource",
        function(a) {
            return a("/home/pay/pay_check")
        }]).factory("PayResult", ["$resource",
        function(a) {
            return a("/home/pay/pay_result")
        }]).factory("PayWayCheck", ["$resource",
        function(a) {
            return a("/home/chat/free_check")
        }]).factory("RefundOption", ["$resource",
        function(a) {
            return a("/home/order/refund_reasons")
        }]).factory("RefundSub", ["$resource",
        function(a) {
            return a("/home/order/active_refund")
        }]).factory("Couponlist", ["$resource",
        function(a) {
            return a("/home/coupon/lists")
        }]).factory("Rewards", ["$resource",
        function(a) {
            return a("/home/pay/goods_list")
        }]).factory("DocRewardsList", ["$resource",
        function(a) {
            return a("/home/reward/lists")
        }]).factory("CallList", ["$resource",
        function(a) {
            return a("/home/call/getDocSchedule", {},
                {
                    post: {
                        method: "POST"
                    }
                })
        }]).factory("CheckCall", ["$resource",
        function(a) {
            return a("/home/call/applyCall", {},
                {
                    post: {
                        method: "POST"
                    }
                })
        }]).factory("UpdateCallMobile", ["$resource",
        function(a) {
            return a("/home/call/updateUserMobile", {},
                {
                    post: {
                        method: "POST"
                    }
                })
        }]).factory("ApptList", ["$resource",
        function(a) {
            return a("/home/appoint/getDocSchedule", {},
                {
                    post: {
                        method: "POST"
                    }
                })
        }]).factory("ElizaApptList", ["$resource",
        function(a) {
            return a("/home/queen/getDocSchedule", {},
                {
                    post: {
                        method: "POST"
                    }
                })
        }]).factory("ApptPrice", ["$resource",
        function(a) {
            return a("/home/appoint/getAppointPrice", {},
                {
                    post: {
                        method: "POST"
                    }
                })
        }]).factory("ElizaApptPrice", ["$resource",
        function(a) {
            return a("/home/queen/getAppointPrice", {},
                {
                    post: {
                        method: "POST"
                    }
                })
        }]).factory("CheckAppt", ["$resource",
        function(a) {
            return a("/home/appoint/applyVipAppoint", {},
                {
                    post: {
                        method: "POST"
                    }
                })
        }]).factory("ElizaCheckAppt", ["$resource",
        function(a) {
            return a("/home/queen/applyAppoint", {},
                {
                    post: {
                        method: "POST"
                    }
                })
        }]).factory("UpdateApptMobile", ["$resource",
        function(a) {
            return a("/home/appoint/updateAppointMobile", {},
                {
                    post: {
                        method: "POST"
                    }
                })
        }]).factory("ELizaUpdateApptMobile", ["$resource",
        function(a) {
            return a("/home/queen/updateAppointMobile", {},
                {
                    post: {
                        method: "POST"
                    }
                })
        }]).factory("ApptLiteSub", ["$resource",
        function(a) {
            return a("/home/appoint/applyLightAppoint")
        }]).factory("ApptOrderList", ["$resource",
        function(a) {
            return a("/home/appoint/listsH5")
        }]).factory("ApptOrderDetail", ["$resource",
        function(a) {
            return a("/home/appoint/getByUser")
        }]).factory("ElizaApptOrderDetail", ["$resource",
        function(a) {
            return a("/home/queen/getAppointDetailH5")
        }]).factory("cancleElizaAppt", ["$resource",
        function(a) {
            return a("/home/queen/cancelVipAppoint")
        }]).factory("GetNotify", ["$resource",
        function(a) {
            return a("/home/notify/detailH5", {},
                {
                    post: {
                        method: "POST"
                    }
                })
        }]).factory("AddNotifyReadNum", ["$resource",
        function(a) {
            return a("/home/notify/addReadNum", {},
                {
                    post: {
                        method: "POST"
                    }
                })
        }]).factory("CreatePatient", ["$resource",
        function(a) {
            return a("/home/patient/add")
        }]).factory("PatientsList", ["$resource",
        function(a) {
            return a("/home/patient/lists")
        }]).factory("GetLastSymptoms", ["$resource",
        function(a) {
            return a("/home/patient/illness_last")
        }]).factory("SymptomsList", ["$resource",
        function(a) {
            return a("/home/illness/lists")
        }]).factory("SymptomsNew", ["$resource",
        function(a) {
            return a("/home/illness/listsNew")
        }]).factory("SubChatInfo", ["$resource",
        function(a) {
            return a("/home/chat/submit_illness")
        }]).factory("ChatList", ["$resource",
        function(a) {
            return a("/home/user/patients_chat")
        }]).factory("CityList", ["$resource",
        function(a) {
            var c = a("/home/user/getRecommendCityList");
            return c
        }]).factory("Recommend", ["$resource", "ResourceFactory",
        function(a, c) {
            return c.createResource("/home/user/getRecommendDocList", {},
                {
                    save: {
                        method: "POST"
                    }
                })
        }]).factory("ResourceFactory", ["$q", "$resource",
        function(a, c) {
            function h(a, c, h) {
                a.then(function() {
                    c.resolve.apply(c, arguments)
                }),
                    a.
                    catch(function() {
                        c.reject.apply(c, arguments)
                    }),
                    c.promise.
                    finally(function() {
                        array.remove(h, c)
                    }),
                    h.push(c)
            }
            function g(g, y, v) {
                var w, $ = [];
                return v = v || {},
                    Object.keys(v).forEach(function(c) {
                        var h = a.defer();
                        v[c].timeout = h.promise,
                            v[c].Canceller = h
                    }),
                    w = c(g, y, v),
                    Object.keys(v).forEach(function(c) {
                        var g = w[c];
                        w[c] = function() {
                            var y = a.defer(),
                                w = g.apply(null, arguments).$promise;
                            return h(w, y, $),
                                {
                                    $promise: y.promise,
                                    abort: function() {
                                        y.reject("Aborted")
                                    },
                                    cancel: function() {
                                        v[c].Canceller.resolve("Call cancelled");
                                        var h = a.defer();
                                        v[c].timeout = h.promise,
                                            v[c].Canceller = h
                                    }
                                }
                        }
                    }),
                    w.abortAll = function() {
                        for (var i = 0; i < $.length; i++) $[i].reject("Aborted all");
                        $ = []
                    },
                    w
            }
            return {
                createResource: function(a, c, h) {
                    return g(a, c, h)
                }
            }
        }]).factory("QARecommend", ["$resource", "ResourceFactory",
        function(a, c) {
            return c.createResource("/home/question/h5lists", {},
                {
                    save: {
                        method: "POST"
                    }
                })
        }]).factory("AD", ["$resource",
        function(a) {
            var c = a("/home/activity/getH5Banner");
            return c
        }]).factory("GetEliza", ["$resource",
        function(a) {
            return a("/home/queen/getDocDetail")
        }]).factory("QrFromShare", ["$resource",
        function(a) {
            return a("/home/question/getQuestionShareQr", {},
                {
                    post: {
                        method: "POST"
                    }
                })
        }]).factory("QrMoreDocsFromShare", ["$resource",
        function(a) {
            return a("/home/user/getOtherDocShareQr", {},
                {
                    post: {
                        method: "POST"
                    }
                })
        }]).factory("QrQueenFromShare", ["$resource",
        function(a) {
            return a("/home/queen/getQueenShareQr", {},
                {
                    post: {
                        method: "POST"
                    }
                })
        }]).factory("CenterInfo", ["$resource",
        function(a) {
            return a("/home/vip/getUserAccount")
        }]).factory("VipGoods", ["$resource",
        function(a) {
            return a("/home/vip/getVipGoods")
        }]).factory("DocRecommendReward", ["$resource",
        function(a) {
            return a("/home/user/getInviteShareResultInfo", {},
                {
                    get: {
                        method: "GET",
                        cache: !0
                    }
                })
        }]).factory("DocRecommendRewardRecord", ["$resource",
        function(a) {
            return a("/home/user/inviteShareEventRecord", {},
                {
                    post: {
                        method: "POST"
                    }
                })
        }]).factory("DocMoreDocRecord", ["$resource",
        function(a) {
            return a("/home/user/shareOtherDocEventRecord", {},
                {
                    post: {
                        method: "POST"
                    }
                })
        }]).factory("msgUserLists", ["$resource", "ResourceFactory",
        function(a, c) {
            return c.createResource("/home/message/userLists", {},
                {
                    save: {
                        method: "POST"
                    }
                })
        }]).factory("msgUserHasRead", ["$resource",
        function(a) {
            return a("/home/message/readU")
        }]).factory("goChatRecord", ["$resource",
        function(a) {
            return a("/home/chat/jumpToChatIndex")
        }]),
    angular.module("myApp.services").factory("payAction", ["$timeout", "DoOrder", "DoOrderContinue", "ParseDate", "Alert", "CheckOrder", "PayResult", "PayLoading", "$window", "$location", "ipCookie",
        function(a, c, h, g, y, v, w, $, b, I, C) {
            var S = !1;
            return function(g, b, L, P) {
                var T, A = function(a) {
                        $.close(),
                            g.showLoading = !1,
                            S = !1,
                        !!T && clearTimeout(T) && (T = null),
                        a && a()
                    },
                    k = 9,
                    D = function(a, c) {
                        v.get(a).$promise.then(function(h) {
                                h.msg.state && 0 !== Number(h.msg.state) ? 5 === Number(h.msg.state) && k ? T = setTimeout(function() {--k,
                                                D(a, c)
                                            },
                                            2e3) : A(function() {
                                            b.go("home.feedbackSuc", {
                                                msg: "支付失败",
                                                icon: "error"
                                            })
                                        }) : A(function() {
                                        P.suc(c)
                                    })
                            },
                            function() {
                                A(),
                                    y.alert("网络出错啦～再试一次！"),
                                P.fail && P.fail()
                            })
                    },
                    _ = function(c) {
                        function h() {
                            WeixinJSBridge.invoke("getBrandWCPayRequest", c.wx,
                                function(h) {
                                    $.alert(),
                                        g.showLoading = !1;
                                    var v = {
                                        docid: L.docid,
                                        tradeNum: c.tradeNum,
                                        tradeRes: h.err_msg
                                    };
                                    b.params.chatId && (v.chatId = b.params.chatId),
                                        w.get(v).$promise.then(function() {
                                                "get_brand_wcpay_request:ok" == h.err_msg ? D(v, c.chatId) : a(function() {
                                                            A(),
                                                                a(function() {
                                                                        y.alert("未成功支付")
                                                                    },
                                                                    500),
                                                            P.fail && P.fail()
                                                        },
                                                        500)
                                            },
                                            function() {
                                                A(),
                                                    y.alert("网络出错啦～再试一次！"),
                                                P.fail && P.fail()
                                            })
                                })
                        }
                        console.log(c),
                            "undefined" == typeof WeixinJSBridge ? document.addEventListener ? document.addEventListener("WeixinJSBridgeReady", h, !1) : document.attachEvent && (document.attachEvent("WeixinJSBridgeReady", h), document.attachEvent("onWeixinJSBridgeReady", h)) : h()
                    },
                    N = function() {
                        if (S) return ! 1;
                        S = !0,
                            g.showLoading = !0;
                        var a = {
                            type: P.type
                        };
                        for (var v in L) a[v] = L[v];
                        if (P.tradeNum) {
                            a.tradeNum = P.tradeNum;
                            var w = h.post(a).$promise
                        } else var w = c.post(a).$promise;
                        w.then(function(a) {
                                if (200 !== a.code) {
                                    if (A(), 801 === a.code) y.alert(a.msg.desc,
                                        function() {
                                            I.path("/fillChatInfo").search({
                                                auth: C("auth"),
                                                docid: C("docid"),
                                                chatId: a.msg.chatId
                                            }).replace()
                                        });
                                    else if (400 === a.code) y.alert(a.msg.desc,
                                        function() {
                                            I.path("/chat").search({
                                                auth: C("auth"),
                                                docid: C("docid"),
                                                pid: a.msg.pid
                                            }).replace()
                                        });
                                    else {
                                        var c = a.msg.desc || a.msg,
                                            h = 802 === a.code ? "知道了": "确定";
                                        y.alert(c,
                                            function() {},
                                            h)
                                    }
                                    P.fail && P.fail()
                                } else a.msg.action && 1 === a.msg.action ? (P.suc(a.msg.chatId), setTimeout(function() {
                                            A()
                                        },
                                        1e3)) : _(a.msg)
                            },
                            function() {
                                y.alert("非常抱歉，发送失败，请重试"),
                                    A(),
                                P.fail && P.fail()
                            })
                    };
                N()
            }
        }]),
    angular.module("myApp.services").service("Time",
        function() {
            this.getTime = function(a) {
                return Date.parse(a) / 1e3
            },
                this.format = function(a) {
                    var c = new Date(1e3 * parseInt(a)),
                        h = c.getFullYear(),
                        g = c.getMonth() + 1;
                    if (10 > g) var g = "0" + g;
                    var y = c.getDate();
                    return h + "-" + g + "-" + y
                }
        }).service("Alert", ["ngDialog", "Chat", "$state", "$timeout",
        function(a, c, h, g) {
            this.alert = function(c, h, y) {
                return a.open({
                    template: "partials/w/alert.html",
                    closeByEscape: !0,
                    closeByDocument: !0,
                    disableAnimation: !0,
                    resolve: {
                        closeAll: ["ngDialog",
                            function(a) {
                                a.closeAll()
                            }],
                        chat: function() {
                            return "[object Array]" !== Object.prototype.toString.call(c) && (c = [c]),
                                c
                        },
                        closeText: function() {
                            return y || "确定"
                        }
                    },
                    controller: ["$scope", "chat", "ngDialog", "closeText",
                        function(a, c, h, g) {
                            a.chats = c,
                                a.closeText = g,
                                a.close = function() {
                                    h.closeAll()
                                }
                        }],
                    preCloseCallback: function() {
                        g(function() {
                            h && h()
                        })
                    }
                })
            }
        }]).service("Notice", ["ngDialog", "$state",
        function(a) {
            this.alert = function(c, h, g) {
                return a.open({
                    template: "partials/w/notice.html",
                    closeByEscape: !1,
                    closeByDocument: !1,
                    disableAnimation: !0,
                    resolve: {
                        texts: function() {
                            return c
                        },
                        sureText: function() {
                            return h || "知道了"
                        }
                    },
                    controller: ["$scope", "texts", "sureText", "ngDialog", "ipCookie",
                        function(a, c, h, y) {
                            a.texts = c,
                                a.sureText = h,
                                a.close = function() {
                                    y.closeAll(),
                                    g && g()
                                }
                        }]
                })
            }
        }]).service("Prompt", ["ngDialog", "$state",
        function(a) {
            this.alert = function(c, h, g, y, v, w) {
                return a.open({
                    template: "partials/w/prompt.html",
                    closeByEscape: !1,
                    closeByDocument: !1,
                    disableAnimation: !0,
                    resolve: {
                        url: function() {
                            return c
                        },
                        titletxt: function() {
                            return h
                        },
                        texts: function() {
                            return g
                        },
                        sureText: function() {
                            return y || "知道了"
                        }
                    },
                    controller: ["$scope", "texts", "sureText", "ngDialog", "ipCookie",
                        function(a, g, y, $) {
                            a.texts = g,
                                a.url = c,
                                a.titletxt = h,
                                a.sureText = y,
                                a.isHeigherBox = w || "",
                                a.close = function() {
                                    $.closeAll(),
                                    v && v()
                                }
                        }]
                })
            }
        }]).service("Confirm", ["ngDialog", "Chat", "$state",
        function(a) {
            this.alert = function(c, h, g, y, v, w, $, b) {
                return a.open({
                    template: "partials/w/confirm.html",
                    closeByEscape: !1,
                    closeByDocument: !1,
                    disableAnimation: !0,
                    resolve: {
                        chat: function() {
                            return c
                        },
                        title: function() {
                            return h
                        }
                    },
                    controller: ["$scope", "$state", "ipCookie", "ngDialog",
                        function(a, I, C, S) {
                            a.title = h,
                                a.value = c,
                                a.sureText = v || "确认提交",
                                a.closeText = w || "取消",
                                a.reverse = $ || !1,
                                a.same = b || !1,
                                a.sure = function() {
                                    g && g(),
                                        S.closeAll()
                                },
                                a.close = function() {
                                    y && y(),
                                        S.closeAll()
                                }
                        }]
                })
            }
        }]).service("Img", ["ngDialog", "$window",
        function(a, c) {
            this.alert = function(h, g) {
                return g ? a.open({
                        template: "partials/w/Img.html",
                        closeByEscape: !0,
                        closeByDocument: !0,
                        disableAnimation: !0,
                        resolve: {
                            url: function() {
                                return h
                            },
                            ngPinchZoom: ["$ocLazyLoad",
                                function(a) {
                                    a.load("//mcdn.anxinyisheng.com/Public/mobile/bower/js/pinchzoom.min_954e460.js")
                                }]
                        },
                        controller: ["$scope", "url", "$window",
                            function(a, c, h) {
                                a.height = h.innerHeight + "px",
                                    a.width = h.innerWidth + "px",
                                    a.url = c
                            }]
                    }) : (c.wx.previewImage({
                        current: h,
                        urls: [h]
                    }), !1)
            }
        }]).service("PayLoading", ["ngDialog",
        function(a) {
            this.alert = function() {
                return a.open({
                    template: "partials/w/payLoading.html",
                    closeByEscape: !1,
                    closeByDocument: !1,
                    disableAnimation: !0,
                    closeByNavigation: !0
                })
            },
                this.close = function() {
                    a.closeAll()
                }
        }]).service("Toast", ["ngDialog",
        function(a) {
            this.alert = function(c, h) {
                return a.open({
                    template: "partials/w/toast.html",
                    closeByEscape: !1,
                    closeByDocument: !1,
                    resolve: {
                        texts: function() {
                            return c
                        }
                    },
                    controller: ["$scope", "texts", "$timeout", "ngDialog", "ipCookie",
                        function(a, c, g, y) {
                            a.texts = c,
                                g(function() {
                                        y.closeAll(),
                                        h && h()
                                    },
                                    1200)
                        }]
                })
            }
        }]),
    angular.module("myApp.services").factory("checkGoChat", ["$timeout", "PayWayCheck", "Chat", "$window", "$location", "ipCookie", "Alert",
        function(a, c, h, g, y, v, w) {
            return function(a, g, y) {
                var v = y.docId;
                c.get({
                    docid: v
                }).$promise.then(function(a) {
                    200 === a.code ? h.exist.get({
                                docid: v
                            },
                            function(c) {
                                if (200 !== c.code) return w.alert(c.msg),
                                    !1;
                                if (("1" == c.msg.status || "2" == c.msg.status) && y.fail && y.fail(), 2 == a.msg.needPay || 3 == a.msg.needPay) {
                                    var h = {
                                        price: a.msg.money
                                    };
                                    y.suc && y.suc(h)
                                } else y.fail && y.fail()
                            }) : y.fail && y.fail()
                })
            }
        }]),
    angular.module("myApp.services").factory("authInterceptor", ["$q", "ipCookie", "$rootScope", "$location", "$stateParams", "CacheInfo", "$timeout",
        function(a, c, h, g, y, v, w) {
            return {
                request: function(g) {
                    if (g.headers = g.headers || {},
                        window.CONFIG && window.CONFIG.auth) var y = CONFIG.auth;
                    else var y = h.auth;
                    if (window.CONFIG && window.CONFIG.wxid) var v = CONFIG.wxid;
                    else var v = h.wxid;
                    return y = y || c("auth"),
                        v = v || c("wxid"),
                        g.headers.Auth = y,
                        g.headers.Wxid = v,
                        g.headers.Channel = "wx_anxinjiankang",
                        g.headers.Imei = localStorage.getItem("ngStorage-imei"),
                    y && c("auth", y),
                    v && c("wxid", v, {
                        expires: 1
                    }),
                    g || a.when(g)
                },
                responseError: function($) {
                    if (401 === $.data.code) {
                        var b = y.docid || y.id || c("docid") || "";
                        v.set("lastPath", {
                            path: g.$$path,
                            search: g.$$search
                        }),
                            w(function() {
                                h.user_level <= 10 ? g.path("/register").search({
                                        docid: b,
                                        wx: $.data.data.wxId
                                    }).replace() : h.user_level > 10 && g.path("/complete").search({
                                        wx: $.data.data.wxId
                                    }).replace()
                            })
                    }
                    return $ || a.when($)
                }
            }
        }]),
    angular.module("myApp.services").factory("CacheInfo",
        function() {
            var a = {};
            return {
                set: function(c, h) {
                    a[c] = h
                },
                get: function(c) {
                    return a[c]
                }
            }
        }).factory("RecommendLastCache",
        function() {
            var a = {};
            return {
                set: function(c, h) {
                    a = {
                        city: c,
                        dept: h
                    }
                },
                get: function() {
                    return a
                }
            }
        }).factory("ChatInfoCache",
        function() {
            var a = {};
            return {
                setCurPatient: function(c, h) {
                    a[c] || (a[c] = {
                        curPatient: "",
                        symptoms: {}
                    }),
                        a[c].curPatient = h
                },
                getCurPatient: function(c) {
                    return a[c] ? a[c].curPatient: !1
                },
                setSymptom: function(c, h, g) {
                    a[c] || (a[c] = {
                        curPatient: h,
                        symptoms: {}
                    }),
                        a[c].symptoms[h] = g
                },
                getSymptom: function(c, h) {
                    return a[c] && a[c].symptoms[h] ? a[c].symptoms[h] : []
                }
            }
        }),
    angular.module("myApp.services").factory("ParseDate",
        function() {
            var a = function(a) {
                    return parseInt(a, 10) >= 10 ? "" + a: "0" + a
                },
                c = function(c) {
                    var h = new Date(parseInt(c, 10));
                    return h.getFullYear() + "-" + a(Number(h.getMonth()) + 1) + "-" + a(h.getDate()) + " " + a(h.getHours()) + ":" + a(h.getMinutes()) + ":" + a(h.getSeconds())
                };
            return c
        }).factory("bLength",
        function() {
            return function(a) {
                if (!a) return 0;
                var c = a.match(/[^\x00-\xff]/g);
                return a.length + (c ? c.length: 0)
            }
        }).factory("leftB", ["bLength",
        function(a) {
            return function(c, h) {
                var d = c.replace(/\*/g, " ").replace(/[^\x00-\xff]/g, "**");
                return c = c.slice(0, d.slice(0, h).replace(/\*\*/g, " ").replace(/\*/g, "").length),
                a(c) > h && h > 0 && (c = c.slice(0, c.length - 1)),
                    c
            }
        }]).factory("makeHistory", ["$rootScope",
        function(a) {
            var c = {};
            return window.addEventListener("popstate",
                function() {
                    var h = a.actualLocation,
                        g = h.split(".")[0],
                        y = c[g];
                    y && y.callback && y.callback()
                },
                !1),
                function(a) {
                    if (!a.name) return ! 1;
                    c[a.name] = a;
                    var h = {};
                    return h.make = function() {
                        window.history.pushState({},
                            "title", "#" + a.name + ".alert")
                    },
                        h.back = function() {
                            window.history.back()
                        },
                        h
                }
        }]).factory("queryToJson",
        function() {
            return function(a, c) {
                for (var h = a.split("&"), g = {},
                         y = function(a) {
                             return c ? decodeURIComponent(a) : a
                         },
                         i = 0, v = h.length; v > i; i++) if (h[i]) {
                    var w = h[i].split("="),
                        $ = w[0],
                        b = w[1];
                    w.length < 2 && (b = $, $ = "$nullName"),
                        g[$] ? (1 != angular.isArray(g[$]) && (g[$] = [g[$]]), g[$].push(y(b))) : g[$] = y(b)
                }
                return g
            }
        }).filter("safe", ["$sce",
        function(a) {
            return function(c) {
                return a.trustAsResourceUrl(c)
            }
        }]).filter("noNum",
        function() {
            return function(a) {
                return a.replace(/[0-9,.]*/g, "")
            }
        }).filter("timeToMinite", ["ParseDate",
        function(a) {
            return function(c) {
                return c ? a(1e3 * parseInt(c, 10)).replace(/-/g, "/").slice(0, 16) : ""
            }
        }]).filter("moneyFloat", [function() {
        return function(a) {
            return a ? Number(a).toFixed(2).split(".")[1] : "00"
        }
    }]).filter("moneyInt", [function() {
        return function(a) {
            return a ? parseInt(a, 10) : 0
        }
    }]).filter("CheckToday", ["ParseDate",
        function(a) {
            return function(c) {
                var h = new Date,
                    g = new Date(parseInt(1e3 * c, 10));
                return g.setHours(0, 0, 0, 0) == h.setHours(0, 0, 0, 0) ? a(parseInt(1e3 * c, 10)).replace(/-/g, "/").slice(10, 16) : a(parseInt(1e3 * c, 10)).replace(/-/g, "/").slice(0, 16)
            }
        }]).factory("ParseDNum",
        function() {
            return function(a) {
                return parseInt(a, 10) >= 10 ? "" + a: "0" + a
            }
        }).factory("DateWithWeek", ["ParseDate", "ParseDNum",
        function(a, c) {
            var h = ["日", "一", "二", "三", "四", "五", "六"],
                g = {
                    nt: "晚上",
                    pm: "下午",
                    am: "上午"
                };
            return function(y, v) {
                var w = {
                        after: "",
                        withDayPart: !1,
                        isOnlyYear: !1
                    },
                    $ = v || {},
                    w = angular.extend(w, $),
                    b = "",
                    I = "";
                if (Number(y)) var C = 1e3 * Number(y);
                else {
                    var C = new Date(y.replace(/-/g, "/")).getTime();
                    w.isOnlyYear = !0
                }
                var S = new Date(C),
                    L = S.getDay(),
                    P = S.getHours(),
                    T = a(C).slice(0, 10).replace(/-/g, "/"); !! w.withDayPart && (b = 12 >= P ? "am": 18 >= P ? "pm": "nt"),
                b && (I = "," + g[b]);
                var A = T + " 周" + h[L] + I;
                return ! w.isOnlyYear && (A += "," + c(P) + ":" + c(S.getMinutes())),
                A + w.after
            }
        }]).factory("getHost", ["$location",
        function(a) {
            return {
                isTest: "test.anxinyisheng.com" === a.$$host,
                host: a.$$protocol + "://" + a.$$host
            }
        }]).factory("GetTime",
        function() {
            return {
                getHour: function(a) {
                    return parseInt(a / 60 / 60)
                },
                getMin: function(a) {
                    return parseInt(a / 60 % 60)
                },
                getSec: function(a) {
                    return parseInt(a % 60)
                }
            }
        }).factory("GetTimeList", ["GetTime",
        function(a) {
            return function(c, h) {
                for (var g = 0; g < h.length; g++) if (1 == h[g].useFree) if (c >= h[g].freeSt && c <= h[g].freeEt) {
                    var y = h[g].freeEt - c;
                    h[g].timefreeSec = a.getSec(y),
                        h[g].timefreeMin = a.getMin(y),
                        h[g].timefreeHour = a.getHour(y),
                        h[g].iftimefree = 1
                } else h[g].iftimefree = 0;
                else h[g].iftimefree = 0;
                return h
            }
        }]).factory("isDuringTime", [function() {
        var a = {
            qafree: {
                start: 14854464e5,
                end: 14861376e5
            }
        };
        return function(c) {
            var h = window.CONFIG ? 1e3 * parseInt(window.CONFIG.serverTime) : (new Date).getTime();
            if (c.type) var g = a[c.type];
            else var g = {
                start: c.start,
                end: c.end
            };
            var y = parseInt(g.start, 10),
                v = parseInt(g.end, 10);
            return {
                isBeforeStart: y > h,
                isDuring: v >= h && h >= y,
                isAfterEnd: h > v
            }
        }
    }]),
    angular.module("myApp.directives", []).directive("set", ["$document", "$window",
        function(a, c) {
            return {
                link: function(a, h) {
                    h.bind("load",
                        function() {
                            var a = c.innerHeight,
                                g = h.prop("offsetWidth"),
                                y = h.prop("offsetHeight"),
                                v = (a - y) / 2 + "px";
                            if (g >= y) {
                                h.css({
                                    width: "100%",
                                    "margin-top": v
                                });
                                var w = h.prop("offsetHeight"),
                                    $ = (a - w) / 2 + "px";
                                h.css({
                                    width: "100%",
                                    "margin-top": $
                                })
                            } else h.css({
                                height: a + "px"
                            })
                        })
                }
            }
        }]).directive("setaudio", ["$document", "$window",
        function() {
            return {
                link: function(a, c, h) {
                    var g = c[0],
                        y = h.setaudio;
                    console.log(h.setaudio),
                        g.addEventListener("ended",
                            function() {
                                var c = {
                                    idx: y,
                                    value: 0
                                };
                                a.$emit("notification", c)
                            },
                            !1)
                }
            }
        }]).directive("hisaudio", ["$document", "$window",
        function() {
            return {
                link: function(a, c, h) {
                    var g = c[0],
                        y = h.hisaudio;
                    g.addEventListener("ended",
                        function() {
                            var c = {
                                idx: y,
                                value: 0
                            };
                            a.$emit("historyaudio", c)
                        },
                        !1)
                }
            }
        }]).directive("setlen", ["$document", "$window",
        function() {
            return {
                link: function(a, c, h) {
                    var g = parseInt(h.setlen),
                        y = g > 12 ? g: 12,
                        v = window.lib.flexible.rem2px(4 * y / 37.5);
                    c.css({
                        width: v + "px"
                    })
                }
            }
        }]).directive("bac", ["$document", "$window",
        function() {
            return {
                link: function(a, c, h) {
                    h.$observe("bac",
                        function(a) {
                            c.css({
                                "background-image": "url(" + a + ")",
                                "background-position": "top right"
                            })
                        })
                }
            }
        }]).directive("servicenumber", ["$document", "$window",
        function(a, c) {
            return {
                link: function(a, h) {
                    var g = c.CONFIG ? c.CONFIG.serviceNumber: "4000889128";
                    g = g.substring(0, 3) + "-" + g.substring(3, 7) + "-" + g.substring(7),
                        h.attr("href", "tel:" + g),
                        h.text(g)
                }
            }
        }]),
    angular.module("myApp.directives").directive("fclick", ["$parse",
        function(a) {
            function c(a) {
                return Math.sqrt(a.x * a.x + a.y * a.y)
            }
            function h(a, c) {
                return a.x * c.x + a.y * c.y
            }
            function g(a, g) {
                var y = c(a) * c(g);
                if (0 === y) return 0;
                var r = h(a, g) / y;
                return r > 1 && (r = 1),
                    Math.acos(r)
            }
            function y(a, c) {
                return a.x * c.y - c.x * a.y
            }
            function v(a, c) {
                var h = g(a, c);
                return y(a, c) > 0 && (h *= -1),
                180 * h / Math.PI
            }
            var w = function(a, c) {
                a.on("touchstart", this.start.bind(this)),
                    a.on("touchmove", this.move.bind(this)),
                    a.on("touchend", this.end.bind(this)),
                    a.on("touchcancel", this.cancel.bind(this)),
                    this.preV = {
                        x: null,
                        y: null
                    },
                    this.pinchStartLen = null,
                    this.scale = 1,
                    this.isDoubleTap = !1,
                    this.rotate = c.rotate ||
                        function() {},
                    this.touchStart = c.touchStart ||
                        function() {},
                    this.multipointStart = c.multipointStart ||
                        function() {},
                    this.multipointEnd = c.multipointEnd ||
                        function() {},
                    this.pinch = c.pinch ||
                        function() {},
                    this.swipe = c.swipe ||
                        function() {},
                    this.tap = c.tap ||
                        function() {},
                    this.doubleTap = c.doubleTap ||
                        function() {},
                    this.longTap = c.longTap ||
                        function() {},
                    this.singleTap = c.singleTap ||
                        function() {},
                    this.pressMove = c.pressMove ||
                        function() {},
                    this.touchMove = c.touchMove ||
                        function() {},
                    this.touchEnd = c.touchEnd ||
                        function() {},
                    this.touchCancel = c.touchCancel ||
                        function() {},
                    this.delta = null,
                    this.last = null,
                    this.now = null,
                    this.tapTimeout = null,
                    this.touchTimeout = null,
                    this.longTapTimeout = null,
                    this.swipeTimeout = null,
                    this.x1 = this.x2 = this.y1 = this.y2 = null,
                    this.preTapPosition = {
                        x: null,
                        y: null
                    }
            };
            w.prototype = {
                start: function(a) {
                    if (a.touches) {
                        this.now = Date.now(),
                            this.x1 = a.touches[0].pageX,
                            this.y1 = a.touches[0].pageY,
                            this.delta = this.now - (this.last || this.now),
                            this.touchStart(a),
                        null !== this.preTapPosition.x && (this.isDoubleTap = this.delta > 0 && this.delta <= 250 && Math.abs(this.preTapPosition.x - this.x1) < 30 && Math.abs(this.preTapPosition.y - this.y1) < 30),
                            this.preTapPosition.x = this.x1,
                            this.preTapPosition.y = this.y1,
                            this.last = this.now;
                        var h = this.preV,
                            g = a.touches.length;
                        if (g > 1) {
                            var y = {
                                x: a.touches[1].pageX - this.x1,
                                y: a.touches[1].pageY - this.y1
                            };
                            h.x = y.x,
                                h.y = y.y,
                                this.pinchStartLen = c(h),
                                this.multipointStart(a)
                        }
                        this.longTapTimeout = setTimeout(function() {
                            this.longTap(a)
                        }.bind(this), 750)
                    }
                },
                move: function(a) {
                    if (a.touches) {
                        var h = this.preV,
                            g = a.touches.length,
                            y = a.touches[0].pageX,
                            w = a.touches[0].pageY;
                        if (this.isDoubleTap = !1, g > 1) {
                            var $ = {
                                x: a.touches[1].pageX - y,
                                y: a.touches[1].pageY - w
                            };
                            null !== h.x && (this.pinchStartLen > 0 && (a.scale = c($) / this.pinchStartLen, this.pinch(a)), a.angle = v($, h), this.rotate(a)),
                                h.x = $.x,
                                h.y = $.y
                        } else null !== this.x2 ? (a.deltaX = y - this.x2, a.deltaY = w - this.y2) : (a.deltaX = 0, a.deltaY = 0),
                            this.pressMove(a);
                        this.touchMove(a),
                            this._cancelLongTap(),
                            this.x2 = y,
                            this.y2 = w,
                        a.touches.length > 1 && a.preventDefault()
                    }
                },
                end: function(a) {
                    if (a.changedTouches) {
                        this._cancelLongTap();
                        var c = this;
                        a.touches.length < 2 && this.multipointEnd(a),
                            this.touchEnd(a),
                            this.x2 && Math.abs(this.x1 - this.x2) > 30 || this.y2 && Math.abs(this.preV.y - this.y2) > 30 ? (a.direction = this._swipeDirection(this.x1, this.x2, this.y1, this.y2), this.swipeTimeout = setTimeout(function() {
                                        c.swipe(a)
                                    },
                                    0)) : this.tapTimeout = setTimeout(function() {
                                        c.tap(a),
                                            c.isDoubleTap ? (c.doubleTap(a), clearTimeout(c.touchTimeout), c.isDoubleTap = !1) : c.touchTimeout = setTimeout(function() {
                                                        c.singleTap(a)
                                                    },
                                                    250)
                                    },
                                    0),
                            this.preV.x = 0,
                            this.preV.y = 0,
                            this.scale = 1,
                            this.pinchStartLen = null,
                            this.x1 = this.x2 = this.y1 = this.y2 = null
                    }
                },
                cancel: function(a) {
                    clearTimeout(this.touchTimeout),
                        clearInterval(this.tapTimeout),
                        clearInterval(this.longTapTimeout),
                        clearInterval(this.swipeTimeout),
                        this.touchCancel(a)
                },
                _cancelLongTap: function() {
                    clearTimeout(this.longTapTimeout)
                },
                _swipeDirection: function(a, c, h, g) {
                    return Math.abs(a - c) >= Math.abs(h - g) ? a - c > 0 ? "Left": "Right": h - g > 0 ? "Up": "Down"
                }
            };
            var $ = function(c, h, g, y) {
                c.$apply(function() {
                    var v = a(h[y]);
                    v(c, {
                        $event: g
                    })
                })
            };
            return function(a, c, h) {
                new w(c, {
                    tap: function(c) {
                        $(a, h, c, "tap")
                    },
                    swipe: function(c) {
                        $(a, h, c, "swipe")
                    }
                })
            }
        }]),
    angular.module("myApp.directives").directive("textRoll", ["$timeout", "$window",
        function(a, c) {
            return function(h, g) {
                var y = g[0];
                h.textrollWidth = 2 * h.elizaScheduleText.length * 10,
                    console.log(h.elizaScheduleText.length);
                var v = 90,
                    w = c.lib.flexible.rem2px(.1),
                    $ = 0,
                    b = function() {
                        0 - $ >= h.textrollWidth ? (y.appendChild(y.children[0]), $ += h.textrollWidth, h.needTransition = !1) : (h.textrollWidth + $ < w ? $ = 0 - h.textrollWidth: $ -= w, h.needTransition = !0),
                            h.textrollLeftTransform = "translateX(" + $ + "px)",
                            a(b, v)
                    };
                a(b, 500)
            }
        }]),
    angular.module("myApp.directives").directive("countdown", ["$window", "$interval",
        function(a, c) {
            return {
                link: function(a, h, g) {
                    console.log(2222);
                    var y, v = g.count.split(","),
                        w = (Number(v[2]), Number(v[1]), Number(v[0])),
                        $ = function() {
                            a.o.iftimefree = !1
                        },
                        b = function() {
                            y = c(function() {
                                    a.o.timefreeHour = --w,
                                    w || (c.cancel(y), $())
                                },
                                1e3)
                        };
                    b()
                }
            }
        }]),
    angular.module("myApp.directives").directive("chatAuto", ["$document", "$window", "Prompt",
        function(a, c, h) {
            return {
                restrict: "ACE",
                scope: !0,
                link: function(a, c, g) {
                    a.now = new Date,
                        a.docIcon = g.docicon || "",
                        a.showExplain = function() {
                            h.alert("", "咨询服务说明", ["• 	若医生在您发起咨询后24小时未回复，系统将自动为您退款；", "• 本服务有效期是自医生回复后24小时，若医生确认已解决您的问题，可提前结束本次咨询。"], "知道了")
                        },
                        a.$on("$destroy",
                            function() {
                                c.remove()
                            })
                },
                templateUrl: "./partials/chatAuto.html"
            }
        }]),
    angular.module("myApp.directives").directive("whenScrolled", ["$window",
        function(a) {
            var c = 0;
            return function(h, g, y) {
                var v = function() {
                    var g = angular.element(a),
                        v = document.body.scrollHeight,
                        w = g.scrollTop(),
                        $ = (new Date).getTime();
                    $ - 300 > c && w >= v - g.height() - a.lib.flexible.rem2px(.5) && (h.$apply(y.whenScrolled), c = $)
                };
                a.addEventListener("scroll", v, !1),
                    h.$on("$destroy",
                        function() {
                            return a.removeEventListener("scroll", v)
                        })
            }
        }]),
    angular.module("myApp.directives").directive("imgonload",
        function() {
            return {
                restrict: "A",
                link: function(a, c, h) {
                    c.bind("load",
                        function() {
                            a.$apply(h.imgonload)
                        }),
                        a.$on("$destroy",
                            function() {
                                return c.unbind("load")
                            })
                }
            }
        });